summaryrefslogtreecommitdiffstats
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Repair vnode locking in portal_lookup(). Specifically, lock the filetjr2003-01-051-2/+10
| | | | | | vnode, and unlock the parent directory vnode if LOCKPARENT is not set. Obtained from: NetBSD (rev. 1.34)
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-045-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-0411-40/+0
| | | | | | | kern/vfs_defaults.c it is wrong for the individual filesystems to use the std* functions as that prevents override of the default. Found by: src/tools/tools/vop_table
* 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
|
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-303-3/+3
| | | | Add FreeBSD Id tag where missing.
* There is some sort of race/deadlock which I have not identifiedphk2002-12-291-1/+6
| | | | | | | | | | here. It manifests itself by sendmail hanging in "fifoow" during boot on a diskless machine with sendmail disabled. Giving the sleep a 1sec timout breaks the deadlock, but does not solve the underlying problem. XXX comment applied.
* Abstract-out the constants for the sequential heuristic.dillon2002-12-281-1/+1
| | | | | | No operational changes. MFC after: 1 day
* Trim left-over and unused vop_refreshlabel() bits from devfs.rwatson2002-12-281-23/+0
| | | | Reported by: bde
* Remove redundant check for negative or zero v_usecount; vrele() alreadytjr2002-12-151-14/+7
| | | | checks that.
* Keep trying to flush the vnode list for the mount while some are stilltjr2002-12-133-2/+19
| | | | | | | | | busy and we are making progress towards making them not busy. This is needed because smbfs vnodes reference their parent directory but may appear after their parent in the mount's vnode list; one pass over the list is not sufficient in this case. This stops attempts to unmount idle smbfs mounts failing with EBUSY.
* Fix build with SMB_VNODE_DEBUG defined; use td_proc->p_pid instead oftjr2002-12-131-1/+2
| | | | the nonexistent td_pid.
* Store a reference to the parent directory's vnode in struct smbnode,tjr2002-12-136-11/+13
| | | | | | not to the parent's smbnode, which may be freed during the lifetime of the child if the mount is forcibly unmounted. umount -f should now work properly (ie. not panic) on smbfs mounts.
* Remove dm_root entry from struct devfs_mount. It's never set, and isrwatson2002-12-094-7/+8
| | | | | | | | | | | | unused. Replace it with a dm_mount back-pointer to the struct mount that the devfs_mount is associated with. Export that pointer to MAC Framework entry points, where all current policies don't use the pointer. This permits the SEBSD port of SELinux's FLASK/TE to compile out-of-the-box on 5.0-CURRENT with full file system labeling support. Approved by: re (murray) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-2/+2
| | | | Verified by: md5
* Cast a pointer to a uintptr_t to quiet a warning.jhb2002-11-071-1/+1
|
* Third argument to copyinstr() is a pointer to a size_t, not a pointer to ajhb2002-11-071-1/+1
| | | | u_int.
* 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.
* Unbreak MNT_UPDATE when running with cd as root. Detect mountroot bypeter2002-11-021-2/+1
| | | | | | | | | checking for "path == NULL" (like ffs) rather than MNT_ROOT. Otherwise when you try and do an update or mountd does an NFS export, the remount fails because the code tries to mount a fresh rootfs and gets an EBUSY. The same bug is in 4.x (which is where I found it). Sanity check by: mux
* 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.
* Fix winChkName() to match when the last slot contains nothing but thesemenu2002-10-291-1/+8
| | | | | | | | terminating zero (it was treated as length missmatch). The mtools create such slots if the name len is the product of 13 (max number of unicode chars fitting in directory slot). MFC after: 1 week
* In VOP_LOOKUP, don't deny DELETE and RENAME operationsmux2002-10-261-1/+2
| | | | | when ISLASTCN is not set. The actual file which is being looked up may live in a different filesystem.
* Slightly change the semantics of vnode labels for MAC: rather thanrwatson2002-10-266-130/+1
| | | | | | | | | | | | | | | | | | | | | "refreshing" the label on the vnode before use, just get the label right from inception. For single-label file systems, set the label in the generic VFS getnewvnode() code; for multi-label file systems, leave the labeling up to the file system. With UFS1/2, this means reading the extended attribute during vfs_vget() as the inode is pulled off disk, rather than hitting the extended attributes frequently during operations later, improving performance. This also corrects sematics for shared vnode locks, which were not previously present in the system. This chances the cache coherrency properties WRT out-of-band access to label data, but in an acceptable form. With UFS1, there is a small race condition during automatic extended attribute start -- this is not present with UFS2, and occurs because EAs aren't available at vnode inception. We'll introduce a work around for this shortly. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* 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>
* Grrr, s/PBP/BPB/ here as well.jhb2002-10-211-1/+1
| | | | Noticed by: peter
* Spell the BPB member of the 7.10 bootsector as bsBPB rather than bsPBP tojhb2002-10-211-1/+1
| | | | be like all the other bootsectors. Apple has done the same it seems.
* Missed a case of _POSIX_MAC_PRESENT -> _PC_MAC_PRESENT rename.rwatson2002-10-201-2/+2
| | | | Pointed out by: phk
* '&' not used for pointers to functions.phk2002-10-201-2/+2
| | | | Spotted by: FlexeLint
* Remove even more '&' from pointers to functions.phk2002-10-201-26/+26
| | | | Spotted by: FlexeLint
* umap_sync is empty and is identical to vfs_stdsync. Remove it andkan2002-10-191-16/+1
| | | | | | use generic function instead. Approved by: obrien
* style(9)kan2002-10-191-4/+7
| | | | Approved by: obrien
* Fix comments and one resulting code confusion about the type of thephk2002-10-168-8/+9
| | | | | | "command" argument to VOP_IOCTL. Spotted by: FlexeLint.
* Be consistent about functions being static.phk2002-10-162-2/+2
| | | | Spotted by: FlexeLint
* A better solution to avoiding variable sized structs in DEVFS.phk2002-10-162-3/+5
|
* #include "opt_devfs.h" to protect against variable sized structures.phk2002-10-161-0/+2
| | | | Spotted by: FlexeLint
* Plug an infrequent (I think) memory leak.phk2002-10-151-1/+3
| | | | Spotted by: FlexeLint
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-1420-121/+7
| | | | | | | | | | | | | | | | | | | | that use it. Specifically, vop_stdlock uses the lock pointed to by vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to reference vp->v_lock. Filesystems that wish to use the default do not need to allocate a lock at the front of their node structure (as some still did) or do a lockinit. They can simply start using vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks, but still use the vop_stdlock functions (such as nullfs) can simply replace vp->v_vnlock with a pointer to the lock that they wish to have used for the vnode. Such filesystems are responsible for setting the vp->v_vnlock back to the default in their vop_reclaim routine (e.g., vp->v_vnlock = &vp->v_lock). In theory, this set of changes cleans up the existing filesystem lock interface and should have no function change to the existing locking scheme. Sponsored by: DARPA & NAI Labs.
* - Remove a useless initialization for 'ronly', if it hadn't beenmux2002-10-131-2/+2
| | | | | there, we would have noticed that 'ronly' was uninitialized :-). - Kill a nearby 'register' keyword.
* Pass flags to VOP_CLOSE() corresponding to what was passed to VOP_OPEN().phk2002-10-131-0/+1
| | | | Submitted by: "Peter Edwards" <pmedwards@eircom.net>
* Change iov_base's type from `char *' to the standard `void *'. Allmike2002-10-112-3/+3
| | | | | uses of iov_base which assume its type is `char *' (in order to do pointer arithmetic) have been updated to cast iov_base to `char *'.
* Treat the pathptrn field as a real pattern with the aid of fnmatch().dd2002-10-081-15/+1
|
* Yet another 64 bits warning fix: s/u_int/size_t/.mux2002-10-061-1/+1
|
* Fix a warning on 64 bits platforms: copyinstr() takesmux2002-10-061-1/+1
| | | | a size_t *, not an u_int *.
* Fix a warning on 64 bits platforms: copystr() takes a size_t *,mux2002-10-061-1/+1
| | | | not an int *.
* Integrate a devfs/MAC fix from the MAC tree: avoid a race condition duringrwatson2002-10-051-4/+3
| | | | | | | | | devfs VOP symlink creation by introducing a new entry point to determine the label of the devfs_dirent prior to allocation of a vnode for the symlink. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
OpenPOWER on IntegriCloud