aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/specfs
Commit message (Collapse)AuthorAgeFilesLines
* use bufdone() not biodone().Poul-Henning Kamp2004-08-081-3/+3
| | | | Notes: svn path=/head/; revision=133327
* Second half of the dev_t cleanup.Poul-Henning Kamp2004-06-171-1/+1
| | | | | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc. Notes: svn path=/head/; revision=130640
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-13/+13
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Nice, is a property of a process as a whole..Julian Elischer2004-06-161-2/+2
| | | | | | | | I mistakenly moved it to the ksegroup when breaking up the process structure. Put it back in the proc structure. Notes: svn path=/head/; revision=130551
* Make vm_page's PG_ZERO flag immutable between the time of the page'sAlan Cox2004-05-061-2/+0
| | | | | | | | | | | | | allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@ Notes: svn path=/head/; revision=128992
* Do not drop Giant around the poll method yet, we're not ready for it.Poul-Henning Kamp2004-04-121-2/+2
| | | | Notes: svn path=/head/; revision=128171
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-071-4/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=128019
* When I was a kid my work table was one cluttered mess an cleaning it upPoul-Henning Kamp2004-03-111-20/+0
| | | | | | | | | | | | | | | | were a rather overwhelming task. I soon learned that if you don't know where you're going to store something, at least try to pile it next to something slightly related in the hope that a pattern emerges. Apply the same principle to the ffs/snapshot/softupdates code which have leaked into specfs: Add yet a buf-quasi-method and call it from the only two places I can see it can make a difference and implement the magic in ffs_softdep.c where it belongs. It's not pretty, but at least it's one less layer violated. Notes: svn path=/head/; revision=126858
* Don't call devsw() more than we need to, and in particular do not exposePoul-Henning Kamp2004-03-101-4/+4
| | | | | | | | | ourselves to device removal by not checking for it the second time. Use count_dev(dev) rather than vcount(vp) Notes: svn path=/head/; revision=126823
* Do not attempt to open NODEVPoul-Henning Kamp2004-02-241-0/+3
| | | | Notes: svn path=/head/; revision=126191
* Device megapatch 6/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126082
* Device megapatch 4/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126080
* Initialize b_iooffset correctly.Poul-Henning Kamp2003-11-131-0/+1
| | | | Notes: svn path=/head/; revision=122608
* Initialize b_iooffset before calling strategyPoul-Henning Kamp2003-10-181-0/+1
| | | | Notes: svn path=/head/; revision=121223
* Initialize b_offset before calling VOP_STRATEGY/VOP_SPECSTRATEGY.Poul-Henning Kamp2003-10-181-1/+0
| | | | | | | | Remove various comments of KASSERTS and comments about B_PHYS which does not apply anymore. Notes: svn path=/head/; revision=121196
* Introduce a new optional memberfunction for cdevsw, fdopen() whichPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=121121
* Synchronize access to a page's valid field by using the lock from itsAlan Cox2003-10-041-1/+2
| | | | | | | containing object. Notes: svn path=/head/; revision=120731
* The valid field in struct vm_page can be of type unsigned long whenMarcel Moolenaar2003-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. Notes: svn path=/head/; revision=119514
* Use the requested page's object field instead of the vnode's. In someAlan Cox2003-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 Notes: svn path=/head/; revision=119318
* Don't drop giant around ->d_strategy(), too much code explodes.Poul-Henning Kamp2003-08-061-3/+3
| | | | Notes: svn path=/head/; revision=118520
* Only drop Giant around the drivers ->d_strategy() if the buffer is notPoul-Henning Kamp2003-08-051-1/+1
| | | | | | | marked to prevent this. Notes: svn path=/head/; revision=118463
* Lock the vm object when freeing a vm page.Alan Cox2003-06-191-0/+2
| | | | Notes: svn path=/head/; revision=116583
* In specfs::vop_specstratey(), assert that the vnode and buffer agree aboutPoul-Henning Kamp2003-06-151-0/+4
| | | | | | | the device. Notes: svn path=/head/; revision=116418
* I have not had any reports of trouble for a long time, so remove thePoul-Henning Kamp2003-06-151-26/+1
| | | | | | | | gentle versions of the vop_strategy()/vop_specstrategy() mismatch methods and use vop_panic() instead. Notes: svn path=/head/; revision=116416
* Take 2: Remove _both_ KASSERTS.Poul-Henning Kamp2003-06-151-2/+0
| | | | Notes: svn path=/head/; revision=116414
* Duh! I misread my handwritte notes: We do _not_ want to asser thatPoul-Henning Kamp2003-06-151-2/+0
| | | | | | | vp == bp->b_vp in specfs, that was the entire point of VOP_SPECSTRATEGY(). Notes: svn path=/head/; revision=116413
* Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementationsPoul-Henning Kamp2003-06-151-0/+4
| | | | | | | to check that the buffer points to the correct vnode. Notes: svn path=/head/; revision=116412
* - Add a lock for protecting against msleep(bp, ...) wakeup(bp) races.Jeff Roberson2003-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. Notes: svn path=/head/; revision=112183
* Finish cleanup of vprint() which was begun with changing v_tag to a string.Nate Lawson2003-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. Notes: svn path=/head/; revision=111841
* Make nokqfilter() return the correct return value.Poul-Henning Kamp2003-03-031-2/+0
| | | | | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers. Notes: svn path=/head/; revision=111821
* Use the SI_CANDELETE flag on the dev_t rather than the D_CANFREE flagPoul-Henning Kamp2003-02-111-3/+1
| | | | | | | on the cdevsw to determine ability to handle the BIO_DELETE request. Notes: svn path=/head/; revision=110700
* - Cleanup unlocked accesses to buf flags by introducing a new b_vflag memberJeff Roberson2003-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 Notes: svn path=/head/; revision=110584
* Don't override the vop_lock, vop_unlock and vop_isunlocked methods.Poul-Henning Kamp2003-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 Notes: svn path=/head/; revision=108716
* Don't take the detour over VOP_STRATEGY from spec_getpages, call ourPoul-Henning Kamp2003-01-051-1/+1
| | | | | | | own strategy directly. Notes: svn path=/head/; revision=108707
* Split out the vnode and buf arguments to the internal strategy workerPoul-Henning Kamp2003-01-051-13/+3
| | | | | | | routine instead of doing evil casts. Notes: svn path=/head/; revision=108706
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryPoul-Henning Kamp2003-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 Notes: svn path=/head/; revision=108686
* resort vnode ops listPoul-Henning Kamp2003-01-041-3/+3
| | | | Notes: svn path=/head/; revision=108681
* Replace spec_bmap() with vop_panic: We should never BMAP a device backedPoul-Henning Kamp2003-01-041-35/+1
| | | | | | | vnode only filesystem backed vnodes. Notes: svn path=/head/; revision=108658
* Convert calls to BUF_STRATEGY to VOP_STRATEGY calls. This is a no-op sincePoul-Henning Kamp2003-01-031-1/+1
| | | | | | | all BUF_STRATEGY did in the first place was call VOP_STRATEGY. Notes: svn path=/head/; revision=108589
* Remove unused second argument from DEV_STRATEGY().Poul-Henning Kamp2003-01-031-3/+3
| | | | Notes: svn path=/head/; revision=108586
* Add debug.doslowdown to enable/disable niced slowdown on I/O. DefaultKirk McKusick2002-11-041-1/+5
| | | | | | | | | to off until locking interference issues get sorted out. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=106402
* Put a KASSERT in specfs::strategy() to check that the incoming bufferPoul-Henning Kamp2002-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. Notes: svn path=/head/; revision=106298
* Within ufs, the ffs_sync and ffs_fsync functions did not alwaysKirk McKusick2002-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. Notes: svn path=/head/; revision=105902
* This checkin reimplements the io-request priority hack in a wayKirk McKusick2002-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> Notes: svn path=/head/; revision=105667
* Fix comments and one resulting code confusion about the type of thePoul-Henning Kamp2002-10-161-1/+1
| | | | | | | | | "command" argument to VOP_IOCTL. Spotted by: FlexeLint. Notes: svn path=/head/; revision=105212
* Be consistent about "static" functions: if the function is markedPoul-Henning Kamp2002-09-281-1/+1
| | | | | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512 Notes: svn path=/head/; revision=104094
* I misplaced a local variable yesterday.Poul-Henning Kamp2002-09-281-1/+1
| | | | Notes: svn path=/head/; revision=104089
* Add a D_NOGIANT flag which can be set in a struct cdevsw to indicatePoul-Henning Kamp2002-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. Notes: svn path=/head/; revision=104048
* I hate it when patch gives me .rej files.Poul-Henning Kamp2002-09-261-0/+1
| | | | | | | | Can't we make the pre-commit check refuse if there are .rej files in the directory ? Notes: svn path=/head/; revision=104012
* Return ENOTTY on unhandled ioctls.Poul-Henning Kamp2002-09-261-2/+5
| | | | Notes: svn path=/head/; revision=104007