summaryrefslogtreecommitdiff
path: root/sys/miscfs/umapfs
AgeCommit message (Collapse)Author
2022-11-04Add a helper to set or clear lower mount and use it.hannken
Always add a reference to the lower mount. Ride 9.99.105
2021-10-20Overhaul of the EVFILT_VNODE kevent(2) filter:thorpej
- Centralize vnode kevent handling in the VOP_*() wrappers, rather than forcing each individual file system to deal with it (except VOP_RENAME(), because VOP_RENAME() is a mess and we currently have 2 different ways of handling it; at least it's reasonably well-centralized in the "new" way). - Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ, compatible with the same events in FreeBSD. - Track which kevent notifications clients are interested in receiving to avoid doing work for events no one cares about (avoiding, e.g. taking locks and traversing the klist to send a NOTE_WRITE when someone is merely watching for a file to be deleted, for example). In support of the above: - Add support in vnode_if.sh for specifying PRE- and POST-op handlers, to be invoked before and after vop_pre() and vop_post(), respectively. Basic idea from FreeBSD, but implemented differently. - Add support in vnode_if.sh for specifying CONTEXT fields in the vop_*_args structures. These context fields are used to convey information between the file system VOP function and the VOP wrapper, but do not occupy an argument slot in the VOP_*() call itself. These context fields are initialized and subsequently interpreted by PRE- and POST-op handlers. - Version VOP_REMOVE(), uses the a context field for the file system to report back the resulting link count of the target vnode. Return this in tmpfs, udf, nfs, chfs, ext2fs, lfs, and ufs. NetBSD 9.99.92.
2020-05-16Add ACL support for FFS. From FreeBSD.christos
2020-04-13Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a functionad
that hides the details and does atomic_load_relaxed(). Signature matches FreeBSD.
2020-03-16Use the module subsystem's ability to process SYSCTL_SETUP() entries topgoyette
automate installation of sysctl nodes. Note that there are still a number of device and pseudo-device modules that create entries tied to individual device units, rather than to the module itself. These are not changed.
2019-08-20Clean up debugging cruft that somehow made it into my previous commit.perseant
2019-08-20Allow the user to specify the filesystem ID for umapfs at mount time,perseant
allowing a consistent filesystem ID across reboots. Closes PR #54471.
2019-02-20Set "mnt_lower" before the first file system operation on the new file system.hannken
2017-06-04Locking a layer vnode using the regular bypass routine is no longerhannken
racy. Undo the change from 2017-03-30 11:16:52, commitid eurqbzuGxGRlryLz and make vi_lock a krwlock_t again.
2017-04-11Field "layerm_vfs" of "struct layer_mount" got superseded by "mnt_lower".hannken
Adapt consumers and remove the now unused field. Ride 7.99.68
2017-03-30Locking a layer vnode is racy as it may become reclaimed beforehannken
calling the operation on the lower vnode. Replace vi_lock with a rw_obj and change layered file systems to share the lock with the lower vnode. Layered file systems now use genfs_lock()/_unlock/_islocked(). Welcome to 7.99.67
2017-03-30Change _fstrans_start() to allocate per lwp info for layered filehannken
systems to get a reference on the mount. Set mnt_lower on successfull mount only.
2017-03-06Add field "mnt_lower" to "struct mount" to track the file systemhannken
a layered file system is mounted on. Welcome to 7.99.65
2017-02-17Add generic genfs_suspendctl() and use it for all file systems.hannken
Layered file systems need work.
2017-01-27Handle v_writecount from layer_open(), layer_close() and layer_revoke()hannken
so lower file system vnodes get marked as open for writing.
2014-11-09Do not uselessly include <sys/malloc.h>.maxv
2014-10-12Define layerfs as an attribute.uebayasi
2014-10-11Define filesystem attributes with vfs dependency.uebayasi
2014-08-111) 'error' is returned while it does not even hold an error code. Whichmaxv
means that zero is returned, and the kernel keeps mounting (and it probably ends up in a deadlock/memory corruption somewhere). 2) 'nentries' and 'gnentries' are int and user-controlled, and there's no check to ensure they are greater than zero. Since they are used to compute the size of two copyin's, a user can control the copied size by giving a negative value (like 128-2^29), and thus overwrite kernel memory. Both triggerable from root only.
2014-05-25Change layerfs from hashlist to vcache.hannken
Make VI_LOCKSHARE public again. Ride 6.99.43
2014-04-16An (un)privileged user can easily make the kernel dereference a NULLmaxv
pointer. The kernel allows 'data' to be NULL; it's the fs's responsibility to ensure that it isn't NULL (if the fs actually needs data). ok christos@
2014-03-23Change all vfsops to use C99 designated initializers.hannken
No functional changes intended.
2014-02-27The current implementation of vn_lock() is racy. Modification ofhannken
the vnode operations vector for active vnodes is unsafe because it is not known whether deadfs or the original file system will be called. - Pass down LK_RETRY to the lock operation (hint for deadfs only). - Change deadfs lock operation to return ENOENT if LK_RETRY is unset. - Change all other lock operations to check for dead vnode once the vnode is locked and unlock and return ENOENT in this case. With these changes in place vnode lock operations will never succeed after vclean() has marked the vnode as VI_XLOCK and before vclean() has changed the operations vector. Adresses PR kern/37706 (Forced unmount of file systems is unsafe) Discussed on tech-kern. Welcome to 6.99.33
2014-02-25Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist beforepooka
the sysctl link sets are processed, and remove redundancy. Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate lines of code.
2014-02-10Change layerfs_vget(), layerfs_fhtovp() and the various layer xxx_mount()hannken
functions to unlock/relock the node for the call to layer_node_create(). Finally remove dirty hacks (LK_NOWAIT, kpause) from layer_node_find().
2014-02-09Adjust comment and change vput() to vrele(). This change got missedhannken
when changing vnode creation operations to return unlocked result.
2014-02-07Change vnode operation lookup to return the resulting vnode *vpp unlocked.hannken
Change cache_lookup() to return an unlocked vnode. Discussed on tech-kern@ Welcome to 6.99.31
2012-04-30- Replace some malloc(9) uses with kmem(9).rmind
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.
2012-03-13Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls withelad
something meaningful. All relevant documentation has been updated or written. Most of these changes were brought up in the following messages: http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html Thanks to christos, manu, njoly, and jmmv for input. Huge thanks to pgoyette for spinning these changes through some build cycles and ATF.
2011-07-11Change VOP_BWRITE() to take a vnode as its first argument like all otherhannken
VOPs do. Layered file systems no longer have to modify bp->b_vp and run into trouble when an async VOP_BWRITE() uses the wrong vnode. - change all occurences of VOP_BWRITE(bp) to VOP_BWRITE(bp->b_vp, bp). - remove layer_bwrite(). - welcome to 5.99.55 Adresses PR kern/38762 panic: vwakeup: neg numoutput No objections from tech-kern@.
2011-04-03- Use offsetof() in VOPARG_OFFSETOF() instead of re-implementing it.rmind
- Remove VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE. - Remove VRELEL_NOINACTIVE and VRELEL_ONHEAD.
2011-01-10Add layer_revoke() that adjusts the lower vnode use count to be at least ashannken
high as the upper vnode count before passing down the VOP_REVOKE(). This way vclean() check for active (vp->v_usecount > 1) vnodes gets it right. Should fix PR kern/43456.
2010-11-19Introduce struct pathbuf. This is an abstraction to hold a pathnamedholland
and the metadata required to interpret it. Callers of namei must now create a pathbuf and pass it to NDINIT (instead of a string and a uio_seg), then destroy the pathbuf after the namei session is complete. Update all namei call sites accordingly. Add a pathbuf(9) man page and update namei(9). The pathbuf interface also now appears in a couple of related additional places that were passing string/uio_seg pairs that were later fed into NDINIT. Update other call sites accordingly.
2010-07-02LK_INTERLOCK is no longer a valid flag for VOP_LOCK(). This makeshannken
layer_*lock*() obsolete. Remove them and handle lock operations with the generic bypass function. Ride 5.99.34.
2010-06-24Clean up vnode lock operations pass 2:hannken
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument. Welcome to 5.99.32. Discussed on tech-kern.
2010-06-06Change layered file systems to always pass the locking VOP's down to thehannken
leaf file system. Remove now unused member v_vnlock from struct vnode. Welcome to 5.99.30 Discussed on tech-kern.
2010-04-11The *_modcmd functions use the module name as prefix.mlelstv
2010-04-11Make module name match MOUNT_NAME. Inspired by PR kern/43110.pooka
2010-01-08The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to livepooka
years ago when the kernel was modified to not alter ABI based on DIAGNOSTIC, and now just call the respective function interfaces (in lowercase). Plenty of mix'n match upper/lowercase has creeped into the tree since then. Nuke the macros and convert all callsites to lowercase. no functional change
2009-03-15ansify function definitionscegger
2009-03-14ANSIfy another 1261 function definitions.dsl
The only ones left in sys are beyond by sed script! (or in sys/dist or sys/external) Mostly they have function pointer parameters.
2009-03-14Change about 4500 of the K&R function definitions to ANSI ones.dsl
There are still about 1600 left, but they have ',' or /* ... */ in the actual variable definitions - which my awk script doesn't handle. There are also many that need () -> (void). (The script does handle misordered arguments.)
2009-02-14add a comment re the vop (?) flag LAYERFS_MBYPASSDEBUG, that if setplunky
could cause a bad pointer dereference in the debug printing when credentials with values of NOCRED or FSCRED were passed to kauth. I don't see any way to set such a flag, I think its just a debug thing that could be enabled at compile time by somebody who knew how, hence the comment rather than a real fix.
2009-02-14consistency checks made inside #ifdef SAFETY should reallyplunky
be #ifdef DIAGNOSTIC
2009-02-13While we remap credentials we should ignore cred == FSCRED as well asplunky
cred == NOCRED. This fixes a page fault occurring when a union is mounted over a umap, as FSCRED is passed by union filesystem.
2008-12-05PR kern/40110: null, overlay and umap modules loading -> panic (layerfs ↵ad
symbols not there) Add a layerfs module.
2008-06-28Create sysctl entries during module initialisation and destroy themrumble
appropriately. Many of these file systems are now ready for modularisation.
2008-05-13mnt_data is a pointer, set it to NULL not 0 when we're finished with it.simonb
2008-05-10Convert file systems to dynamically attach with the new module interface.rumble
Make VFS hooks dynamic while we're here and say farewell to VFS_ATTACH and VFS_HOOKS_ATTACH linksets. As a consequence, most of the file systems can now be loaded as new style modules. Quick sanity check by ad@.
2008-05-05- Convert hashinit() to use kmem_alloc(). The hash tables can be largead
and it's better to not have them in kmem_map. - Convert a couple of minor items along the way to kmem_alloc(). - Fix some memory leaks.