summaryrefslogtreecommitdiffstats
path: root/sys/fs/specfs
Commit message (Collapse)AuthorAgeFilesLines
* Do not attempt to open NODEVphk2004-02-241-0/+3
|
* Device megapatch 6/6:phk2004-02-211-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | This is what we came here for: Hang dev_t's from their cdevsw, refcount cdevsw and dev_t and generally keep track of things a lot better than we used to: Hold a cdevsw reference around all entrances into the device driver, this will be necessary to safely determine when we can unload driver code. Hold a dev_t reference while the device is open. KASSERT that we do not enter the driver on a non-referenced dev_t. Remove old D_NAG code, anonymous dev_t's are not a problem now. When destroy_dev() is called on a referenced dev_t, move it to dead_cdevsw's list. When the refcount drops, free it. Check that cdevsw->d_version is correct. If not, set all methods to the dead_*() methods to prevent entrance into driver. Print warning on console to this effect. The device driver may still explode if it is also incompatible with newbus, but in that case we probably didn't get this far in the first place.
* Device megapatch 4/6:phk2004-02-211-8/+8
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Initialize b_iooffset correctly.phk2003-11-131-0/+1
|
* Initialize b_iooffset before calling strategyphk2003-10-181-0/+1
|
* Initialize b_offset before calling VOP_STRATEGY/VOP_SPECSTRATEGY.phk2003-10-181-1/+0
| | | | | Remove various comments of KASSERTS and comments about B_PHYS which does not apply anymore.
* Introduce a new optional memberfunction for cdevsw, fdopen() whichphk2003-10-151-2/+7
| | | | | | | | passes the fdidx from VOP_OPEN down. This is for all I know the final API for this functionality, but the locking semantics for messing with the filedescriptor from the device driver are not settled at this time.
* Synchronize access to a page's valid field by using the lock from itsalc2003-10-041-1/+2
| | | | containing object.
* The valid field in struct vm_page can be of type unsigned long whenmarcel2003-08-281-2/+2
| | | | | | 32K pages are selected. In spec_getpages() change the printf format specifier and add an explicit cast so that we always print the field as a long type.
* Use the requested page's object field instead of the vnode's. In somealc2003-08-221-2/+5
| | | | | | | cases, the vnode's object field is not initialized leading to a NULL pointer dereference when the object is locked. Tested by: rwatson
* Don't drop giant around ->d_strategy(), too much code explodes.phk2003-08-061-3/+3
|
* Only drop Giant around the drivers ->d_strategy() if the buffer is notphk2003-08-051-1/+1
| | | | marked to prevent this.
* Lock the vm object when freeing a vm page.alc2003-06-191-0/+2
|
* In specfs::vop_specstratey(), assert that the vnode and buffer agree aboutphk2003-06-151-0/+4
| | | | the device.
* I have not had any reports of trouble for a long time, so remove thephk2003-06-151-26/+1
| | | | | gentle versions of the vop_strategy()/vop_specstrategy() mismatch methods and use vop_panic() instead.
* Take 2: Remove _both_ KASSERTS.phk2003-06-151-2/+0
|
* Duh! I misread my handwritte notes: We do _not_ want to asser thatphk2003-06-151-2/+0
| | | | vp == bp->b_vp in specfs, that was the entire point of VOP_SPECSTRATEGY().
* Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementationsphk2003-06-151-0/+4
| | | | to check that the buffer points to the correct vnode.
* - 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
|
OpenPOWER on IntegriCloud