summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Close the remaining user address mapping races for physicaldillon2003-01-201-6/+26
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* - Hold the page queues lock around vm_page_hold().alc2003-01-201-0/+2
| | | | | - Assert that the page queues lock rather than Giant is held in vm_page_hold().
* Fix two long-standing, but likely harmless, errors in the use ofalc2003-01-161-2/+2
| | | | | | | | | | | | | vm_pageout_deficit: 1. Update vm_pageout_deficit before VM_WAIT. There is no sense in delaying the update; the sooner the pageout daemon receives this information the better. Reviewed by: tegge 2. Update vm_pageout_deficit according to the number of pages still needed to complete the allocation, not the original size of the allocation. Submitted by: tegge (These errors have existed since the introduction of vm_pageout_deficit in revision 1.144.)
* Merge all the various copies of vmapbuf() and vunmapbuf() into a singledillon2003-01-151-0/+76
| | | | | | | | portable copy. Note that pmap_extract() must be used instead of pmap_kextract(). This is precursor work to a reorganization of vmapbuf() to close remaining user/kernel races (which can lead to a panic).
* - Update vm_pageout_deficit using atomic operations. It's a simplealc2003-01-141-2/+4
| | | | | counter outside the scope of existing locks. - Eliminate a redundant clearing of vm_pageout_deficit.
* vm_hold_load_pages() needn't clear PG_ZERO because it didn't passalc2003-01-121-1/+0
| | | | VM_ALLOC_ZERO to vm_page_alloc(). (PG_ZERO is clear by default.)
* Make bogus_offset local to bufinit().alc2003-01-071-6/+1
|
* Fix cut&paste bug which would result in a panic because buffer wasphk2003-01-051-2/+2
| | | | being biodone'ed multiple times.
* Allocate bogus_page with VM_ALLOC_WIRED. (Previously, bogus_page'salc2003-01-051-2/+1
| | | | | | allocation incremented the global count of wired pages, but not the page's own wire count. This inconsistency was introduced in revision 1.230.)
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org
* Don't call VOP_BMAP on VCHR vnodes when the logical and physical blockphk2003-01-041-1/+1
| | | | numbers are identical: it cannot even hope to accomplish anything.
* Convert calls to BUF_STRATEGY to VOP_STRATEGY calls. This is a no-op sincephk2003-01-031-1/+1
| | | | all BUF_STRATEGY did in the first place was call VOP_STRATEGY.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Hold the page queues lock when calling vm_page_flag_clear().alc2002-12-271-0/+6
|
* - Hold the kernel_object's lock around vm_page_alloc(kernel_object,...).alc2002-12-231-0/+6
| | | | - Hold the page queues lock around vm_page_wakeup().
* The buffer daemon cannot skip over buffers owned by locked inodes asmckusick2002-12-141-46/+64
| | | | | | | | | | | | | | | they may be the only viable ones to flush. Thus it will now wait for an inode lock if the other alternatives will result in rollbacks (and immediate redirtying of the buffer). If only buffers with rollbacks are available, one will be flushed, but then the buffer daemon will wait briefly before proceeding. Failing to wait briefly effectively deadlocks a uniprocessor since every other process writing to that filesystem will wait for the buffer daemon to clean up which takes close enough to forever to feel like a deadlock. Reported by: Archie Cobbs <archie@dellroad.org> Sponsored by: DARPA & NAI Labs. Approved by: re
* Hold the page queues/flags lock when calling vm_page_set_validclean().alc2002-11-231-1/+5
| | | | Approved by: re
* Now that pmap_remove_all() is exported by our pmap implementationsalc2002-11-161-2/+2
| | | | use it directly.
* When prot is VM_PROT_NONE, call pmap_page_protect() directly rather thanalc2002-11-101-2/+2
| | | | | | | | | indirectly through vm_page_protect(). The one remaining page flag that is updated by vm_page_protect() is already being updated by our various pmap implementations. Note: A later commit will similarly change the VM_PROT_READ case and eliminate vm_page_protect().
* When the number of dirty buffers rises too high, the buf_daemon runsmckusick2002-10-181-3/+17
| | | | | | | | | | | | | | to help clean up. After selecting a potential buffer to write, this patch has it acquire a lock on the vnode that owns the buffer before trying to write it. The vnode lock is necessary to avoid a race with some other process holding the vnode locked and trying to flush its dirty buffers. In particular, if the vnode in question is a snapshot file, then the race can lead to a deadlock. To avoid slowing down the buf_daemon, it does a non-blocking lock request when trying to lock the vnode. If it fails to get the lock it skips over the buffer and continues down its queue looking for buffers to flush. Sponsored by: DARPA & NAI Labs.
* Remove unused includes.phk2002-09-281-4/+4
| | | | | Clarify the intention of a while(); Move a local variable to avoid potential name-confusion.
* Be consistent about "static" functions: if the function is markedphk2002-09-281-1/+1
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Correctly order VI_UNLOCK(), local variables and block comment.phk2002-09-281-4/+4
|
* Make biowait() check bio_error before the BIO_ERROR flag, to properyphk2002-09-261-2/+2
| | | | | | catch internal GEOM use of bio_error. Sponsored by: DARPA & NAI Labs.
* - Lock accesses to v_numoutput.jeff2002-09-251-0/+16
| | | | - Lock calls to gbincore.
* s/Danglish/English/phk2002-09-151-4/+5
| | | | | | | Some style issues. Change the timeout to be hz/10 instead of hz. Brucification by: bde.
* Un-inline the non-trivial "trivial" bio* functions.phk2002-09-141-0/+39
| | | | Untangle devstat_end_transaction_bio()
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-09-141-1/+2
| | | | | | | | | | | | v_tag is now const char * and should only be used for debugging. Additionally: 1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK 2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP. Suggested by: phk Reviewed by: bde, rwatson (earlier version)
* Oops, broke the build there. Uninline biodone() now that it is non-trivial.phk2002-09-131-0/+28
| | | | | | | | | Introduce biowait() function. Currently there is a race condition and the mitigation is a timeout/retry. It is not obvious what kind of locking (if any) is suitable for BIO_DONE, since the majority of users take are of this themselves, and only a few places actually rely on the wakeup. Sponsored by: DARPA & NAI Labs.
* Change hw.physmem and hw.usermem to unsigned long like they used to bepeter2002-08-301-1/+1
| | | | | | | | | | | | | in the original hardwired sysctl implementation. The buf size calculator still overflows an integer on machines with large KVA (eg: ia64) where the number of pages does not fit into an int. Use 'long' there. Change Maxmem and physmem and related variables to 'long', mostly for completeness. Machines are not likely to overflow 'int' pages in the near term, but then again, 640K ought to be enough for anybody. This comes for free on 32 bit machines, so why not?
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-2/+2
|
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-3/+5
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* o Convert two instances of vm_page_sleep_busy() to vm_page_sleep_if_busy()alc2002-08-031-7/+6
| | | | with appropriate page queue locking.
* o Acquire the page queues lock before calling vm_page_io_finish().alc2002-08-011-2/+4
| | | | o Assert that the page queues lock is held in vm_page_io_finish().
* o Replace vm_page_sleep_busy() with vm_page_sleep_if_busy()alc2002-07-301-7/+4
| | | | in vfs_busy_pages().
* o Use vm_page_alloc(... | VM_ALLOC_WIRED) in place of vm_page_wire().alc2002-07-191-4/+3
|
* Add support to UFS2 to provide storage for extended attributes.mckusick2002-07-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As this code is not actually used by any of the existing interfaces, it seems unlikely to break anything (famous last words). The internal kernel interface to manipulate these attributes is invoked using two new IO_ flags: IO_NORMAL and IO_EXT. These flags may be specified in the ioflags word of VOP_READ, VOP_WRITE, and VOP_TRUNCATE. Specifying IO_NORMAL means that you want to do I/O to the normal data part of the file and IO_EXT means that you want to do I/O to the extended attributes part of the file. IO_NORMAL and IO_EXT are mutually exclusive for VOP_READ and VOP_WRITE, but may be specified individually or together in the case of VOP_TRUNCATE. For example, when removing a file, VOP_TRUNCATE is called with both IO_NORMAL and IO_EXT set. For backward compatibility, if neither IO_NORMAL nor IO_EXT is set, then IO_NORMAL is assumed. Note that the BA_ and IO_ flags have been `merged' so that they may both be used in the same flags word. This merger is possible by assigning the IO_ flags to the low sixteen bits and the BA_ flags the high sixteen bits. This works because the high sixteen bits of the IO_ word is reserved for read-ahead and help with write clustering so will never be used for flags. This merge lets us get away from code of the form: if (ioflags & IO_SYNC) flags |= BA_SYNC; For the future, I have considered adding a new field to the vattr structure, va_extsize. This addition could then be exported through the stat structure to allow applications to find out the size of the extended attribute storage and also would provide a more standard interface for truncating them (via VOP_SETATTR rather than VOP_TRUNCATE). I am also contemplating adding a pathconf parameter (for concreteness, lets call it _PC_MAX_EXTSIZE) which would let an application determine the maximum size of the extended atribute storage. Sponsored by: DARPA & NAI Labs.
* o Lock page queue accesses by vm_page_wire().alc2002-07-141-0/+6
|
* o Lock some page queue accesses, in particular, those by vm_page_unwire().alc2002-07-131-1/+6
|
* Replace the global buffer hash table with per-vnode splay trees using adillon2002-07-101-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | methodology similar to the vm_map_entry splay and the VM splay that Alan Cox is working on. Extensive testing has appeared to have shown no increase in overhead. Disadvantages Dirties more cache lines during lookups. Not as fast as a hash table lookup (but still N log N and optimal when there is locality of reference). Advantages vnode->v_dirtyblkhd is now perfectly sorted, making fsync/sync/filesystem syncer operate more efficiently. I get to rip out all the old hacks (some of which were mine) that tried to keep the v_dirtyblkhd tailq sorted. The per-vnode splay tree should be easier to lock / SMPng pushdown on vnodes will be easier. This commit along with another that Alan is working on for the VM page global hash table will allow me to implement ranged fsync(), optimize server-side nfs commit rpcs, and implement partial syncs by the filesystem syncer (aka filesystem syncer would detect that someone is trying to get the vnode lock, remembers its place, and skip to the next vnode). Note that the buffer cache splay is somewhat more complex then other splays due to special handling of background bitmap writes (multiple buffers with the same lblkno in the same vnode), and B_INVAL discontinuities between the old hash table and the existence of the buffer on the v_cleanblkhd list. Suggested by: alc
* Fixed some printf format errors (one new one reported by gcc and 3 nearbybde2002-07-081-2/+2
| | | | old ones not reported by gcc). This helps unbreak LINT.
* Add two asserts that prove & document getblk and geteblk's behavior ofjeff2002-07-071-0/+2
| | | | returning locked bufs.
* Fix a mistake in my last commit. Don't grab an extra reference to the objectjeff2002-07-061-1/+0
| | | | in bp->b_object.
* Fixup uses of GETVOBJECT.jeff2002-07-061-15/+10
| | | | | | | | | | | - Cache a pointer to the vnode's object in the buf. - Hold a reference to that object in addition to the vnode's reference just to be consistent. - Cleanup code that got the object indirectly through the vp and VOP calls. This fixes at least one case where we were calling GETVOBJECT without a lock. It also avoids an expensive layered call at the cost of another pointer in struct buf.
* More 64 bits platforms warning fixes.mux2002-06-231-4/+4
| | | | Reviewed by: rwatson
* Fix a bug in vfs_bio_clrbuf(). The single-page-clrbuf optimization wasdillon2002-06-221-5/+10
| | | | | | | | improperly clearing more then just the invalid portions of the page. (This bug is not known to have been triggered by anything). Submitted by: tegge MFC after: 7 days
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-211-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
* Use "bwrbg" as description when we sleep for background writing,phk2002-06-061-1/+1
| | | | "biord" was misleading in every possible way.
* Remove a six year old undocumented #ifdef : NO_B_MALLOC.phk2002-05-041-12/+0
|
OpenPOWER on IntegriCloud