Commit Graph

52 Commits

Author SHA1 Message Date
pk 37d77087e8 Check `b_dev' field in bdwrite() before using it as an index into bdevsw[].
`b_dev' value of NODEV happens and is normal if the buffer is on its way
to the underlying device strategy function for the first time.

Also, MFS sillily uses a major device number (255) which cannot be used
to index bdevsw[]. Check marked with XXXs.
1997-07-08 22:03:30 +00:00
pk b7b1073fd0 In bread() and breadn(): if getblk() returns a DELWRI buffer, don't
call biowait() but return `success' immediately. We can return `success'
because buffers with recorded errors are not returned by getblk().
(Takes care of PR#3694).
1997-07-08 21:42:59 +00:00
mycroft 6911ff7d13 Fix two performance issues:
* When a delayed write buffer falls off the LRU queue, arrange for it to go on
  the AGE queue after being flushed out to disk.
* When a delayed write buffer is synced, leave it in its relative position in
  the LRU queue.
1997-04-09 21:12:10 +00:00
cgd c8e4c454f2 curproc was being used directly for ru_{in,ou}block counting. Instead
of using it directly, use a local, and set that local to be curproc
if curproc is not NULL else a pointer to process 0's proc struct.
If syncing disks while handling a panic that occurred while 'curproc'
was NULL, the old code would dereference NULL and die.
1996-10-15 23:06:27 +00:00
christos f443b89c92 backout previous kprintf change 1996-10-13 02:32:29 +00:00
christos 60d201973e printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:46:11 +00:00
mycroft 506cefab8c In the sync case of bwrite(), move the accounting earlier so that so that the
delayed write is logically converted to a sync write, mirroring the async case.
In bdwrite(), move the tape case earlier to avoid needless reassignbuf()s.
1996-06-18 20:50:23 +00:00
pk b298c40fbe Call reassignbuf() at splbio in bdwrite(). 1996-06-17 22:21:31 +00:00
pk 50e7d72655 Protect vnode when updating for started IO on buffers. 1996-06-11 11:15:36 +00:00
christos 4ef330b934 remove include of <sys/cpu.h> 1996-04-22 01:38:12 +00:00
fvdl 56a654e17f Changes for NVSv3 code: pull in more NFS include files into kern_time.c
to get types right (overkill for just one function call, but oh well).
Clear B_NEEDCOMMIT in bdwrite().
1996-02-18 11:57:06 +00:00
christos 09afd77655 More proto fixes 1996-02-09 18:59:18 +00:00
christos e630447d8c First pass at prototyping 1996-02-04 02:17:43 +00:00
cgd 32b4385a97 fix bug pointed out by, and do the cleanup suggested by
Alasdair Baird <alasdair@wildcat.demon.co.uk>.  From pr 1301.
1995-08-02 22:01:46 +00:00
cgd f5bbdfba41 bdwrite() should upgrade writes to tape devices by sending them to
bawrite().  it's logically more correct (doesn't return an error code,
because it's async; bdwrite is also async), it still writes things
in-order, it makes sure the proper accountins is done (see the
wasdelayed cases in bwrite()), and it allows writes to vnodes on volumes
mountd with the MNT_ASYNC to be converted into delayed writes the way
God, err, Kirk intended.  Convert synchronous bwrite()s on MNT_ASYNC
file systems to delayed writes.
1995-07-12 07:56:31 +00:00
cgd 9c3fe30d92 fix long-standing XXX in getblk(): NFS does funky things (somewhat
explained in comments), which can cause a race condition.  amazingly,
the _only_ time i've ever seen or heard of this problem was in some
comments and sources by Rick Macklem, and when running against the
a DEC OSF/1 NFS server running on an Alpha.
1995-07-12 07:39:00 +00:00
cgd 3176641085 fix pr 1128; change vfs_bufstats defn from DIAGNOSTIC - > DEBUG 1995-06-20 10:42:33 +00:00
mycroft 04a0a9a518 Use the new d_type field. 1995-04-10 00:46:51 +00:00
mycroft 642eb11a86 Various code rearrangement. 1994-11-22 01:31:02 +00:00
cgd 6ac2bbfc35 be more careful with types, also pull in headers where necessary. 1994-10-30 21:43:03 +00:00
mycroft f5232de492 Patch to fix `reassignbuf: NULL' messages, from cgd. 1994-08-29 01:47:02 +00:00
cgd ea01579f35 light clean up, use some macros 1994-07-03 07:57:32 +00:00
cgd cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
mycroft 11884bb842 Minor cleanup. 1994-06-14 19:36:14 +00:00
mycroft 699bbb84b6 Update to 4.4-Lite fs code. 1994-06-08 11:28:29 +00:00
cgd ffde2d4a28 minor type pointed out by Onno van der Linden 1994-06-05 13:00:49 +00:00
mycroft 766c830cb5 Clear more flags in brelse(). 1994-05-29 22:50:50 +00:00
mycroft facfcdd2ef Cluster routines want 0-sized bufs. 1994-05-27 11:05:54 +00:00
cgd 7f683b3792 some paranoia, also, clean up spaces vs. tabs 1994-05-19 03:04:01 +00:00
cgd c18ec4dca5 my two favorite reference books 1994-05-18 10:51:13 +00:00
cgd fbd5b44ec7 forgot the damned rcsid 1994-05-18 10:28:14 +00:00
cgd ddca406d72 significant rework, to match 4.4-Lite interfaces, and to comment more
closely from Bach.
1994-05-18 10:24:54 +00:00
cgd 179c5769e3 notdef out vn_bwrite out, for now, so that kernels compile, until new fs stuff 1994-05-17 10:50:56 +00:00
mycroft 6c7bd3b00f Implement new functions for 4.4-Lite file systems, and some general cleanup. 1994-05-17 03:43:46 +00:00
cgd 009e6dd4e9 rearrange some splfoo 1994-04-28 01:17:00 +00:00
cgd ed7e1b86da clean up a little bit, and minor optimization... 1994-04-26 05:40:35 +00:00
cgd 3dda0064a5 Convert mount, vnode, and buf structs to use <sys/queue.h>. Also,
some knf and structure frobbing to do along with it.
1994-04-21 07:47:31 +00:00
ws ce516ff13d Make FFS optional 1994-03-09 21:21:37 +00:00
cgd 07c0d9025d get rid of jolitz hack, and add panic() where appropriate 1994-01-27 07:39:32 +00:00
mycroft 7f50bd1829 Canonicalize all #includes. 1993-12-18 04:21:37 +00:00
cgd 76dbc1192b new specfs.h and fifo.h locations 1993-11-12 05:54:12 +00:00
cgd 889b512ea4 if you try to allocate a buffer larger than MAXBSIZE, panic. 1993-10-26 19:38:55 +00:00
cgd 2ff9ed5060 fix my last change; for some reason i thought that 'p' was defined
in these functions.  use curproc instead.
1993-10-19 23:41:44 +00:00
cgd dfaa02a09b pay for block i/o. slightly different than how done by Mark Tinguely. 1993-10-19 02:47:56 +00:00
cgd 714fa4716b changed the Debugger() call, which not all kernels have, to panic(),
but only when DIAGNOSTIC is defined.
1993-10-06 07:24:21 +00:00
cgd 772436479d new, improved, and rationally-implemented vfs_bio. no more serious
structural changes should happen, as it now does the right thing
w.r.t. buffer resizing and having lots of buffers vs. relatively
little buffer space.  Ports can now "do the standard thing", re:
nbuf and bufpages, which is make nbuf = bufpages by default.
1993-10-04 04:56:28 +00:00
cgd e27f6e3ea0 patch from Christoph Badura <bad@flatlin.ka.sub.org> to fix credential
use by read-ahead blocks.  This fixes those weak NFS authentication
messages, and allows us to use BSDI NFS servers again...
1993-10-01 21:47:11 +00:00
cgd 1d0f22a29a convert to use the buffers which are (now) statically allocated at
startup in machdep.c...  buffers are now *never* allocated after boot.
currently, the limitation that says bufpages must cover nbuf*MAXBSIZE
still exists, but this is one step closer to removing that limitation.
1993-09-29 04:49:15 +00:00
cgd 94ac210002 rewrite biodone to the spec in the daemon book, and to account for
the fact that buffers with B_CALL set shouldn't be brelse()'d.
1993-09-21 00:40:02 +00:00
cgd cd56dd1638 merge in changes from netbsd-0-9-ALPHA2 1993-08-07 07:53:27 +00:00