summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
Commit message (Collapse)AuthorAgeFilesLines
...
* /* -> /*- 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
|
* Collapse vnode->v_object and buf->b_object into bufobj->bo_object.phk2004-10-251-4/+0
|
* Move the buffer method vector (buf->b_op) to the bufobj.phk2004-10-241-0/+1
| | | | | | | | | | | | | | | | | Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
* When MAC is enabled, warn if getnewvnode() is asked to produce a vnoderwatson2004-10-221-0/+2
| | | | | | without a mountpoint. In this scenario, there's no useful source for a label on the vnode, since we can't query the mountpoint for the labeling strategy or default label.
* Alas, poor SPECFS! -- I knew him, Horatio; A filesystem of infinitephk2004-10-221-3/+3
| | | | | | | | | | | jest, of most excellent fancy: he hath taught me lessons a thousand times; and now, how abhorred in my imagination it is! my gorge rises at it. Here were those hacks that I have curs'd I know not how oft. Where be your kludges now? your workarounds? your layering violations, that were wont to set the table on a roar? Move the skeleton of specfs into devfs where it now belongs and bury the rest.
* Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.phk2004-10-221-87/+64
| | | | | | | | | | | | | | | | | | Initialize b_bufobj for all buffers. Make incore() and gbincore() take a bufobj instead of a vnode. Make inmem() local to vfs_bio.c Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj) also VI_MTX() to BO_MTX(), Make buf_vlist_add() take a bufobj instead of a vnode. Eliminate other uses of bp->b_vp where bp->b_bufobj will do. Various minor polishing: remove "register", turn panic into KASSERT, use new function declarations, TAILQ_FOREACH_SAFE() etc.
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITphk2004-10-211-55/+22
| | | | | | | | | | Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write count on a bufobj. Bufobj_wdrop() replaces vwakeup(). Use these functions all relevant places except in ffs_softdep.c where the use if interlocked_sleep() makes this impossible. Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
* Add BO_* macros parallel to VI_* macros for manipulating the bo_mtx.phk2004-10-211-7/+11
| | | | | | | | | Initialize the bo_mtx when we allocate a vnode i getnewvnode() For now we point to the vnodes interlock mutex, that retains the exact same locking sematics. Move v_numoutput from vnode to bufobj. Add renaming macro to postpone code sweep.
* Polish vtruncbuf() to improve readability and style a bit.phk2004-10-211-49/+42
|
* Simplify buf_vlist_remove().phk2004-10-211-34/+16
| | | | | Now that we have encapsulated the splaytree related information into a structure we can eliminate the half of this function.
* vtryrecycle: Don't rely on type VBAD alone to mean that we don't needgrog2004-10-061-1/+1
| | | | | | to clean the vnode. If v_data is set, we still need to clean it. This code change should catch all incidents of the previous commit (INVARIANTS only).
* getnewvnode: Weaken the panic "cleaned vnode isn't" to a warning.grog2004-10-061-1/+3
| | | | | | | | | | | | | | Discussion: this panic (or waning) only occurs when the kernel is compiled with INVARIANTS. Otherwise the problem (which means that the vp->v_data field isn't NULL, and represents a coding error and possibly a memory leak) is silently ignored by setting it to NULL later on. Panicking here isn't very helpful: by this time, we can only find the symptoms. The panic occurs long after the reason for "not cleaning" has been forgotten; in the case in point, it was the result of severe file system corruption which left the v_type field set to VBAD. That issue will be addressed by a separate commit.
* Fix a LOR relating to freeing cdevs.phk2004-10-011-8/+2
|
* Hold dev_lock and check for NULL devsw pointer when we determinephk2004-09-241-1/+5
| | | | if a vnode is a disk.
* Do not refcount the cdevsw, but rather maintain a cdev->si_threadcountphk2004-09-231-24/+17
| | | | | | | | | | of the number of threads which are inside whatever is behind the cdevsw for this particular cdev. Make the device mutex visible through dev_lock() and dev_unlock(). We may want finer granularity later. Replace spechash_mtx use with dev_lock()/dev_unlock().
* Remove unused B_WRITEINPROG flagphk2004-09-151-1/+0
|
* Create simple function init_va_filerev() for initializing a va_filerevphk2004-09-071-0/+13
| | | | | | | | | field. Replace three instances of longhaired initialization va_filerev fields. Added XXX comment wondering why we don't use random bits instead of uptime of the system for this purpose.
* Don't attempt to trigger the syncer thread final sync code in thetruckman2004-08-201-0/+3
| | | | | | | | | | shutdown_pre_sync state if the RB_NOSYNC flag is set. This is the likely cause of hangs after a system panic that are keeping crash dumps from being done. This is a MFC candidate for RELENG_5. MFC after: 3 days
* s/MAX_SAFE_MAXVNODES/MAXVNODES_MAX/gobrien2004-08-161-5/+6
|
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-151-5/+16
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* In v_addpollinfo(), we allocate storage to back vp->v_pollinfo. However,rwatson2004-08-111-1/+7
| | | | | | | | | we may sleep when doing so; check that we didn't race with another thread allocating storage for the vnode after allocation is made to a local pointer, and only update the vnode pointer if it's still NULL. Otherwise, accept that another thread got there first, and release the local storage. Discussed with: jmg
* Skip the syncing disks loop if there are no dirty buffers. Remove anjl2004-08-101-1/+1
| | | | | | variable used to flag the initial printf. Submitted by: truckman (earlier version)
* Put a cap on the auto-tuning of kern.maxvnodes.obrien2004-08-021-0/+8
| | | | Cap value chosen by: scottl
* Minor message cleanup.njl2004-07-301-2/+1
|
* Convert the vfsconf list to a TAILQ.phk2004-07-271-21/+10
| | | | | | | | Introduce vfs_byname() function to find things on it. Staticize vfs_nmount() function under the name vfs_donmount(). Various cleanups.
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-261-6/+6
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* Eliminate unused second argument to reassignbuf() and simplify itphk2004-07-251-31/+12
| | | | accordingly.
* put several of the options for DEBUG_VFS_LOCKS under control of sysctls.alfred2004-07-211-0/+14
|
* Cleanup shutdown output.alfred2004-07-151-2/+1
|
* Tidy up system shutdown.alfred2004-07-151-1/+11
|
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-4/+4
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
OpenPOWER on IntegriCloud