summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* - Enable SMP VFS by default on current. More users are needed to turn upjeff2005-02-231-1/+5
| | | | | | | any remaining bugs. Anyone inconvenienced by this can still disable it in the loader. Sponsored by: Isilon Systems, Inc.
* - Only the xlock holder should be calling VOP_LOCK on a vp once VI_XLOCKjeff2005-02-231-0/+5
| | | | | | | has been set. Assert that this is the case so that we catch filesystems who are using naked VOP_LOCKs in illegal cases. Sponsored by: Isilon Systems, Inc.
* - Add a check for xlock in vop_lock_assert. Presently the xlock isjeff2005-02-221-1/+2
| | | | | | | considered to be as good as an exclusive lock, although there is still a possibility of someone acquiring a VOP LOCK while xlock is held. Sponsored by: Isilon Systems, Inc.
* Zero the v_un container field to make sure everything is gone.phk2005-02-221-1/+1
|
* Reap more benefits from DEVFS:phk2005-02-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List devfs_dirents rather than vnodes off their shared struct cdev, this saves a pointer field in the vnode at the expense of a field in the devfs_dirent. There are often 100 times more vnodes so this is bargain. In addition it makes it harder for people to try to do stypid things like "finding the vnode from cdev". Since DEVFS handles all VCHR nodes now, we can do the vnode related cleanup in devfs_reclaim() instead of in dev_rel() and vgonel(). Similarly, we can do the struct cdev related cleanup in dev_rel() instead of devfs_reclaim(). rename idestroy_dev() to destroy_devl() for consistency. Add LIST_ENTRY de_alias to struct devfs_dirent. Remove v_specnext from struct vnode. Change si_hlist to si_alist in struct cdev. String new devfs vnodes' devfs_dirent on si_alist when we create them and take them off in devfs_reclaim(). Fix devfs_revoke() accordingly. Also don't clear fields devfs_reclaim() will clear when called from vgone(); Let devfs_reclaim() call dev_rel() instead of vgonel(). Move the usecount tracking from dev_rel() to devfs_reclaim(), and let dev_rel() take a struct cdev argument instead of vnode. Destroy SI_CHEAPCLONE devices in dev_rel() (instead of devfs_reclaim()) when they are no longer used. (This should maybe happen in devfs_close() instead.)
* Remove vfinddev(), it is generally bogus when faced with jails andphk2005-02-221-20/+0
| | | | chroot and has no legitimate use(r)s in the tree.
* Try to unbreak the vnode locking around vop_reclaim() (based mostly onphk2005-02-191-36/+30
| | | | | | | | | patch from kan@). Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on close. This is not yet a generally safe function, but for this very specific use it is safe. This solves the problem with buffers not being flushed by unmount or after failed mount attempts.
* Make sure to drop the VI_LOCK in vgonel();phk2005-02-181-1/+3
| | | | Spotted by: Taku YAMAMOTO <taku@tackymt.homeip.net>
* Introduce vx_wait{l}() and use it instead of home-rolled versions.phk2005-02-171-6/+31
|
* Convert KASSERTS to VNASSERTSphk2005-02-171-22/+27
|
* Make various vnode related functions staticphk2005-02-101-65/+9
|
* Don't pass NULL to vprint()phk2005-02-101-1/+1
|
* - Add a new assert in the getnewvnode(). Assert that the usecount is stilljeff2005-02-081-2/+4
| | | | | | | 0 to detect getnewvnode() races. - Add the vnode address to a few panics near by to help in debugging. Sponsored by: Isilon Systems, Inc.
* Access vmobject via the bufobj instead of the vnodephk2005-02-071-11/+11
|
* Don't call VOP_DESTROYVOBJECT(), trust that VOP_RECLAIM() did whatphk2005-02-071-2/+3
| | | | was necessary.
* Remove unused argument to vrecycle()phk2005-01-281-7/+1
|
* Integrate vclean() into vgonel().phk2005-01-281-68/+51
| | | | Various associated polishing.
* Remove register keywordphk2005-01-281-5/+5
|
* Don't use VOP_GETVOBJECT, use vp->v_object directly.phk2005-01-251-11/+12
|
* Eliminate the constant flags argument to vclean()phk2005-01-241-16/+8
|
* Change vprint() to vn_printf() which takes varargs.phk2005-01-241-12/+15
| | | | Add #define for vprint() to call vn_printf().
* Kill the VV_OBJBUF and test the v_object for NULL instead.phk2005-01-241-2/+0
|
* - Add the tunable and sysctl for the mpsafevfs. It currently defaultsjeff2005-01-241-37/+49
| | | | | | | | | | | | | | | to off. - Protect access to mnt_kern_flag with the mointpoint mutex. - Remove some KASSERTs which are not legal checks without the appropriate locks held. - Use VCANRECYCLE() rather than rolling several slightly different checks together. - Return from vtryrecycle() with a recycled vnode rather than a locked vnode. This simplifies some locking. - Remove several GIANT_REQUIRED lines. - Add a few KASSERTs to help with INACT debugging. Sponsored By: Isilon Systems, Inc.
* Fix a bug I introduced in 1.561 which has caused considerable filesystemphk2005-01-161-5/+5
| | | | | | | | | unhappiness lately. As far as I can tell, no files that have made it safely to disk have been endangered, but stuff in transit has been in peril. Pointy hat: phk
* Eliminate unused and unnecessary "cred" argument from vinvalbuf()phk2005-01-141-4/+3
|
* Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()phk2005-01-131-16/+0
| | | | directly.
* Add BO_SYNC() and add a default which uses the secret vnode pointerphk2005-01-111-1/+1
| | | | and VOP_FSYNC() for now.
* More vnode -> bufobj migration.phk2005-01-111-12/+13
|
* Give flushbuflist() a struct bufv as first argument and avoid home-rollingphk2005-01-111-36/+21
| | | | | | | | TAILQ_FOREACH_SAFE(). Loose the error pointer argument and return any errors the normal way. Return EAGAIN for the case where more work needs to be done.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-3/+3
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Since we do not support forceful unmount of DEVFS we can do away withphk2005-01-041-45/+3
| | | | the partially implemented vnode-readoption code in vgonechrl().
* We can only ever get to vgonechrl() from a devfs vnode, so we do notphk2004-12-201-2/+0
| | | | | | | need to reassign the vp->v_op to devfs_specops, we know that is the value already. Make devfs_specops private to devfs.
* The remaining part of nmount/omount/rootfs mount changes. I cannot sensiblyphk2004-12-071-114/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split the conversion of the remaining three filesystems out from the root mounting changes, so in one go: cd9660: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() nfs(client): Convert to nmount (the simple way, mount_nfs(8) is still necessary). Add omount compat shims. Drop COMPAT_PRELITE2 mount arg compatibility. ffs: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() Remove vfs_omount() method, all filesystems are now converted. Remove MNTK_WANTRDWR, handling RO/RW conversions is a filesystem task, and they all do it now. Change rootmounting to use DEVFS trampoline: vfs_mount.c: Mount devfs on /. Devfs needs no 'from' so this is clean. symlink /dev to /. This makes it possible to lookup /dev/foo. Mount "real" root filesystem on /. Surgically move the devfs mountpoint from under the real root filesystem onto /dev in the real root filesystem. Remove now unnecessary getdiskbyname(). kern_init.c: Don't do devfs mounting and rootvnode assignment here, it was already handled by vfs_mount.c. Remove now unused bdevvp(), addaliasu() and addalias(). Put the few necessary lines in devfs where they belong. This eliminates the second-last source of bogo vnodes, leaving only the lemming-syncer. Remove rootdev variable, it doesn't give meaning in a global context and was not trustworth anyway. Correct information is provided by statfs(/).
* Improve vprint() a little bit: break long lines, reduce indent and tellphk2004-12-031-4/+7
| | | | if the VI_LOCK() is held.
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-011-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
* Move pbgetvp() and pbrelvp() to vm_pager.c with the rest of the pbuf stuff.phk2004-11-151-46/+0
|
* Move the bit of the syncer which deals with vnodes into a separatephk2004-11-141-36/+46
| | | | function.
* Eliminate vop_revoke() function now that devfs_revoke() does the entire job.phk2004-11-131-42/+0
|
* Slim vnodes by another four bytes by eliminating the (now) unused fieldphk2004-11-101-2/+0
| | | | v_cachedid.
* Remove vn_todev()phk2004-11-101-13/+0
|
* Remove vnode->v_cachedfs.phk2004-11-091-1/+0
| | | | | It was only used for the highly dangerous "export all vnodes with a sysctl" function.
* Remove buf->b_dev field.phk2004-11-041-2/+0
|
* Always initialize bo_private along with bo_ops in getnewvnode().phk2004-11-031-1/+1
| | | | Spotted by: tegge
* Loose vfs_mountedon()phk2004-10-291-13/+0
|
* Give the bufobj a private __bo_vnode for now to keep the syncer floating [1]phk2004-10-291-1/+2
| | | | | | | | At some point later the syncer will unlearn about vnodes and the filesystems method called by the syncer will know enough about what's in bo_private to do the right thing. [1] Ok, I know, but I couldn't resist the pun.
* Move the syncer linkage from vnode to bufobj.phk2004-10-271-34/+42
| | | | | This is not quite a perfect separation: the syncer still think it knows that everything is a vnode.
* Put the I/O block size in bufobj->bo_bsize.phk2004-10-261-1/+4
| | | | | | | We keep si_bsize_phys around for now as that is the simplest way to pull the number out of disk device drivers in devfs_open(). The correct solution would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth when filesystems sit on GEOM, so don't bother for now.
* Loose the v_dirty* and v_clean* alias macros.phk2004-10-251-6/+8
| | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST().
* Remove vnode->v_bsize. This was a dead-end.phk2004-10-251-4/+1
|
OpenPOWER on IntegriCloud