summaryrefslogtreecommitdiffstats
path: root/sys/fs/specfs
Commit message (Collapse)AuthorAgeFilesLines
* - Add a lock for protecting against msleep(bp, ...) wakeup(bp) races.jeff2003-03-131-17/+2
| | | | | | | | | | - Create a new function bdone() which sets B_DONE and calls wakup(bp). This is suitable for use as b_iodone for buf consumers who are not going through the buf cache. - Create a new function bwait() which waits for the buf to be done at a set priority and with a specific wmesg. - Replace several cases where the above functionality was implemented without locking with the new functions.
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-3/+2
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* Make nokqfilter() return the correct return value.phk2003-03-031-2/+0
| | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
* Use the SI_CANDELETE flag on the dev_t rather than the D_CANFREE flagphk2003-02-111-3/+1
| | | | on the cdevsw to determine ability to handle the BIO_DELETE request.
* - Cleanup unlocked accesses to buf flags by introducing a new b_vflag memberjeff2003-02-091-81/+2
| | | | | | | | | | that is protected by the vnode lock. - Move B_SCANNED into b_vflags and call it BV_SCANNED. - Create a vop_stdfsync() modeled after spec's sync. - Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some fs specific processing. This gives all of these filesystems proper behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag. - Annotate the locking in buf.h
* Don't override the vop_lock, vop_unlock and vop_isunlocked methods.phk2003-01-051-3/+0
| | | | | | | | | | | | Previously all filesystems which relied on specfs to do devices would have private overrides for vop_std*, so the vop_no* overrides here had no effect. I overlooked the transitive nature of the vop vectors when I removed the vop_std* in those filesystems. Removing the override here restores device node locking to it's previous modus operandi. Spotted by: bde
* Don't take the detour over VOP_STRATEGY from spec_getpages, call ourphk2003-01-051-1/+1
| | | | own strategy directly.
* Split out the vnode and buf arguments to the internal strategy workerphk2003-01-051-13/+3
| | | | routine instead of doing evil casts.
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* resort vnode ops listphk2003-01-041-3/+3
|
* Replace spec_bmap() with vop_panic: We should never BMAP a device backedphk2003-01-041-35/+1
| | | | vnode only filesystem backed vnodes.
* 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.
* Remove unused second argument from DEV_STRATEGY().phk2003-01-031-3/+3
|
* Add debug.doslowdown to enable/disable niced slowdown on I/O. Defaultmckusick2002-11-041-1/+5
| | | | | | to off until locking interference issues get sorted out. Sponsored by: DARPA & NAI Labs.
* Put a KASSERT in specfs::strategy() to check that the incoming bufferphk2002-11-011-2/+8
| | | | | | | | has a valid b_iocmd. Valid is any one of BIO_{READ,WRITE,DELETE}. I have seen at least one case where the bio_cmd field was zero once the request made it into GEOM. Putting the KASSERT here allows us to spot the culprit in the backtrace.
* Within ufs, the ffs_sync and ffs_fsync functions did not alwaysmckusick2002-10-251-4/+14
| | | | | | | | | | | | check for and/or report I/O errors. The result is that a VFS_SYNC or VOP_FSYNC called with MNT_WAIT could loop infinitely on ufs in the presence of a hard error writing a disk sector or in a filesystem full condition. This patch ensures that I/O errors will always be checked and returned. This patch also ensures that every call to VFS_SYNC or VOP_FSYNC with MNT_WAIT set checks for and takes appropriate action when an error is returned. Sponsored by: DARPA & NAI Labs.
* This checkin reimplements the io-request priority hack in a waymckusick2002-10-221-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that works in the new threaded kernel. It was commented out of the disksort routine earlier this year for the reasons given in kern/subr_disklabel.c (which is where this code used to reside before it moved to kern/subr_disk.c): ---------------------------- revision 1.65 date: 2002/04/22 06:53:20; author: phk; state: Exp; lines: +5 -0 Comment out Kirks io-request priority hack until we can do this in a civilized way which doesn't cause grief. The problem is that it is not generally safe to cast a "struct bio *" to a "struct buf *". Things like ccd, vinum, ata-raid and GEOM constructs bio's which are not entrails of a struct buf. Also, curthread may or may not have anything to do with the I/O request at hand. The correct solution can either be to tag struct bio's with a priority derived from the requesting threads nice and have disksort act on this field, this wouldn't address the "silly-seek syndrome" where two equal processes bang the diskheads from one edge to the other of the disk repeatedly. Alternatively, and probably better: a sleep should be introduced either at the time the I/O is requested or at the time it is completed where we can be sure to sleep in the right thread. The sleep also needs to be in constant timeunits, 1/hz can be practicaly any sub-second size, at high HZ the current code practically doesn't do anything. ---------------------------- As suggested in this comment, it is no longer located in the disk sort routine, but rather now resides in spec_strategy where the disk operations are being queued by the thread that is associated with the process that is really requesting the I/O. At that point, the disk queues are not visible, so the I/O for positively niced processes is always slowed down whether or not there is other activity on the disk. On the issue of scaling HZ, I believe that the current scheme is better than using a fixed quantum of time. As machines and I/O subsystems get faster, the resolution on the clock also rises. So, ten years from now we will be slowing things down for shorter periods of time, but the proportional effect on the system will be about the same as it is today. So, I view this as a feature rather than a drawback. Hence this patch sticks with using HZ. Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@critter.freebsd.dk>
* Fix comments and one resulting code confusion about the type of thephk2002-10-161-1/+1
| | | | | | "command" argument to VOP_IOCTL. Spotted by: FlexeLint.
* 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
* I misplaced a local variable yesterday.phk2002-09-281-1/+1
|
* Add a D_NOGIANT flag which can be set in a struct cdevsw to indicatephk2002-09-271-13/+76
| | | | | | | | | | | | that a particular device driver is not Giant-challenged. SPECFS will DROP_GIANT() ... PICKUP_GIANT() around calls to the driver in question. Notice that the interrupt path is not affected by this! This does _NOT_ work for drivers accessed through cdevsw->d_strategy() ie drivers for disk(-like), some tapes, maybe others.
* I hate it when patch gives me .rej files.phk2002-09-261-0/+1
| | | | | Can't we make the pre-commit check refuse if there are .rej files in the directory ?
* Return ENOTTY on unhandled ioctls.phk2002-09-261-2/+5
|
* - Fix a botch in previous commit; oldvp should not be unconditionallyjeff2002-09-261-2/+3
| | | | assigned.
* - Lock access to the buf lists in spec_sync()jeff2002-09-251-7/+15
| | | | - Fixup interlock locking in spec_close()
* 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)
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-8/+19
| | | | | | | | | | | | | | | - 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
* - Explicitly state that specfs does not support locking by usingjeff2002-07-271-0/+3
| | | | | vop_no{lock,unlock,islocked}. This should be the only vnode opv that does so.
* o Lock page queue accesses by vm_page_activate() and vm_page_deactivate().alc2002-07-271-1/+2
|
* Remove a check of blocknumbers/offsets which will be pointless withphk2002-05-181-12/+0
| | | | | | 64 bit daddr_t. Sponsored by: DARPA & NAI Labs.
* Lock proctree_lock instead of pgrpsess_lock.jhb2002-04-161-2/+2
|
* Remove __P.alfred2002-03-191-15/+15
|
* If in strategy we find that we have no devsw on the device anymore wephk2002-03-051-3/+6
| | | | | are probably talking about some disk-device which wente away, so return ENXIO instead of panicing.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-4/+4
| | | | reference.
* Lock struct pgrp, session and sigio.tanimura2002-02-231-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* Various nit-picking, mostly of style(9) character.phk2002-02-101-43/+41
| | | | Obtained from: ~bde/sys.dif.gz
* Change the kernel's ucred API as follows:jhb2001-10-111-5/+4
| | | | | | | | - crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise.
* o Modify generic specfs device open access control checks to userwatson2001-09-261-4/+8
| | | | | | securelevel_ge() instead of direct securelevel variable checks. Obtained from: TrustedBSD Project
* KSE Milestone 2julian2001-09-121-25/+25
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-3/+2
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* Don't acquire/release Giant around some of the places that need it injhb2001-05-231-2/+1
| | | | spec_getpages(). Instead, assert that Giant is held by the caller.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+4
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Backed out previous commit. It cause massive filesystem corruption,bde2001-04-301-0/+1
| | | | | | | | | | | | | | | | | | | not to mention a compile-time warning about the critical function becoming unused, by replacing spec_bmap() with vop_stdbmap(). ntfs seems to have the same bug. The factor for converting specfs block numbers to physical block numbers is 1, but vop_stdbmap() uses the bogus factor btodb(ap->a_vp->v_mount->mnt_stat.f_iosize), which is 16 for ffs with the default block size of 8K. This factor is bogus even for vop_stdbmap() -- the correct factor is related to the filesystem blocksize which is not necessarily the same to the optimal i/o size. vop_stdbmap() was apparently cloned from nfs where these sizes happen to be the same. There may also be a problem with a_vp->v_mount being null. spec_bmap() still checks for this, but I think the checks in specfs are dead code which used to support block devices.
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-1/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* Revert consequences of changes to mount.h, part 2.grog2001-04-291-2/+0
| | | | Requested by: bde
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* Fixes to track snapshot copy-on-write checking in the specinfomckusick2001-03-071-2/+2
| | | | | | structure rather than assuming that the device vnode would reside in the FFS filesystem (which is obviously a broken assumption with the device filesystem).
* Extend kqueue down to the device layer.jlemon2001-02-151-0/+19
| | | | Backwards compatible approach suggested by: peter
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Add a BUF_KERNPROC() in the BIO_DELETE path.phk2001-01-301-0/+1
| | | | This seems to fix the problem which md(4) backed filesystems exposed.
OpenPOWER on IntegriCloud