summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs
Commit message (Collapse)AuthorAgeFilesLines
* Add explicit struct ucred * argument for VOP_VPTOCNP, to be used bykib2009-06-211-1/+2
| | | | | | | | | | vn_open_cred in default implementation. Valid struct ucred is needed for audit and MAC, and curthread credentials may be wrong. This further requires modifying the interface of vn_fullpath(9), but it is out of scope of this change. Reviewed by: rwatson
* Implement the bypass routine for VOP_VPTOCNP in nullfs.kib2009-05-311-1/+50
| | | | | | | | Among other things, this makes procfs <pid>/file working for executables started from nullfs mount. Tested by: pho PR: 94269, 104938
* Do not drop vnode interlock in null_checkvp(). null_lock() verifies thatkib2009-05-311-22/+7
| | | | | | | | | | | v_data is not-null before calling NULLVPTOLOWERVP(), and dropping the interlock allows for reclaim to clean v_data and free the memory. While there, remove unneeded semicolons and convert the infinite loops to panics. I have a will to remove null_checkvp() altogether, or leave it as a trivial stub, but not now. Reported and tested by: pho
* Lock the real null vnode lock before substitution of vp->v_vnlock.kib2009-05-311-3/+4
| | | | | | | | This should not really matter for correctness, since vp->v_lock is not locked before the call, and null_lock() holds the interlock, but makes the control flow for reclaim more clear. Tested by: pho
* Add VOP_ACCESSX, which can be used to query for newly added V*trasz2009-05-301-0/+27
| | | | | | | | permissions, such as VWRITE_ACL. For a filsystems that don't implement it, there is a default implementation, which works as a wrapper around VOP_ACCESS. Reviewed by: rwatson@
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-19/+12
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Do not use null_bypass for VOP_ISLOCKED, directly call defaultpho2009-03-181-0/+1
| | | | | | | implementation. null_bypass cannot work for the !nullfs-vnodes, in particular, for VBAD vnodes. In collaboration with: kib
* Remove the null_islocked() overloaded vop because the standard one doesattilio2009-03-131-9/+0
| | | | the same.
* Do not use bypass for vop_vptocnp() from nullfs, call standardkib2009-03-101-0/+1
| | | | | | | | | implementation instead. The bypass does not assume that returned vnode is only held. Reported by: Paul B. Mahol <onemda gmail com>, pluknet <pluknet gmail com> Reviewed by: jhb Tested by: pho, pluknet <pluknet gmail com>
* Remove unused local variables.bz2009-01-311-2/+0
| | | | | | Submitted by: Christoph Mallon christoph.mallon@gmx.de Reviewed by: kib MFC after: 2 weeks
* In null_lookup(), do the needed cleanup instead of panicing sayingkib2008-11-261-5/+4
| | | | | | | | the cleanup is needed. Reported by: kris, pho Tested by: pho MFC after: 2 weeks
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessarytrasz2008-10-281-2/+2
| | | | | | | to add more V* constants, and the variables changed by this patch were often being assigned to mode_t variables, which is 16 bit. Approved by: rwatson (mentor)
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-232-4/+4
| | | | MFC after: 3 months
* Fix two small typo's in comments in the nullfs vnops code.ed2008-09-111-2/+2
| | | | Submitted by: Jille Timmermans <jille quis cx>
* Add the support for the AT_FDCWD and fd-relative name lookups to thekib2008-03-311-0/+1
| | | | | | | | | namei(9). Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* - Simplify null_hashget() and null_hashins() by using vref() ratherjeff2008-03-291-21/+4
| | | | | than a complex series of steps involving vget() without a lock type to emulate the same thing.
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-252-5/+4
| | | | | | | | | always curthread. As KPI gets broken by this patch, manpages and __FreeBSD_version will be updated by further commits. Tested by: Andrea Barberio <insomniac at slackware dot it>
* Conver all explicit instances to VOP_ISLOCKED(arg, NULL) intoattilio2008-02-081-3/+3
| | | | | | | | VOP_ISLOCKED(arg, curthread). Now, VOP_ISLOCKED() and lockstatus() should only acquire curthread as argument; this will lead in axing the additional argument from both functions, making the code cleaner. Reviewed by: jeff, kib
* Cleanup lockmgr interface and exported KPI:attilio2008-01-241-2/+1
| | | | | | | | | | | | | | | | | | | | - Remove the "thread" argument from the lockmgr() function as it is always curthread now - Axe lockcount() function as it is no longer used - Axe LOCKMGR_ASSERT() as it is bogus really and no currently used. Hopefully this will be soonly replaced by something suitable for it. - Remove the prototype for dumplockinfo() as the function is no longer present Addictionally: - Introduce a KASSERT() in lockstatus() in order to let it accept only curthread or NULL as they should only be passed - Do a little bit of style(9) cleanup on lockmgr.h KPI results heavilly broken by this change, so manpages and FreeBSD_version will be modified accordingly by further commits. Tested by: matteo
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-132-9/+7
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-102-3/+3
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Get rid of qaddr_t.alfred2007-10-161-1/+1
| | | | Requested by: bde
* This changes give nullfs correctly work with latest unionfs.daichi2007-10-142-5/+25
| | | | | | | Submitted by: Masanori Ozawa <ozawa@ongs.co.jp> (unionfs developer) Reviewed by: jeff, kensmith Approved by: re (kensmith) MFC after: 1 week
* Where I previously removed calls to kdb_enter(), now remove include ofrwatson2007-05-292-2/+0
| | | | | | kdb.h. Pointed out by: bde
* Rather than entering the debugger via kdb_enter() in the event therwatson2007-05-271-5/+2
| | | | | root vnode is unexpectedly locked under NULLFS_DEBUG in nullfs and then returning EDEADLK, panic.
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionkib2007-05-181-2/+2
| | | | | | function calls are no more generated for vop_lock. Rename _vop_lock to vop_lock1 to satisfy tools/vnode_if.awk assumption about vop naming conventions. This restores pre/post-condition calls.
* Make insmntque() externally visibile and allow it to fail (e.g. duringtegge2007-03-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-152-13/+10
| | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs
* change vop_lock handling to allowing tracking of callers' file and line forkmacy2006-11-131-2/+2
| | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.tegge2006-09-261-1/+6
| | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl().
* Remove incorrect null_checkexp() routine. Thisrodrigc2006-05-281-14/+0
| | | | | | | | | | | will allow the NFS server to call vfs_stdcheckexp() on the exported nullfs filesystem, not the underlying filesystem being nullfs mounted. If the lower filesystem was not NFS exported, then the NFS exported null filesystem would not work. Pointed out by: scottl PR: kern/87906 MFC after: 1 week
* Modify MNT_UPDATE behavior for nullfs so that it does notrodrigc2006-05-281-2/+7
| | | | | | | | return EOPNOTSUPP if an "export" parameter was passed in. This should allow nullfs mounts to be NFS exported. PR: kern/87906 MFC after: 1 week
* - Define a null_getwritemount to get the mount-point for the lowerjeff2006-03-121-2/+26
| | | | | | | filesystem so that nullfs doesn't permit you to circumvent snapshots. Discussed with: tegge Sponsored by: Isilon Systems, Inc.
* - spell VOP_LOCK(vp, LK_RELEASE... VOP_UNLOCK(vp,... so that asserts injeff2006-02-221-7/+8
| | | | | | | | | | | vop_lock_post do not trigger. - Rearrange null_inactive to null_hashrem earlier so there is no chance of finding the null node on the hash list after the locks have been switched. - We should never have a NULL lowervp in null_reclaim() so there is no need to handle this situation. panic instead. MFC After: 1 week
* - Assert that the lowervp is locked in null_hashget().jeff2006-02-221-26/+21
| | | | | | | | | | - Simplify the logic dealing with recycled vnodes in null_hashget() and null_hashins(). Since we hold the lower node locked in both cases the null node can not be undergoing recycling unless reclaim somehow called null_nodeget(). The logic that was in place was not safe and was essentially dead code. MFC After: 1 week
* Correctly set MNTK_MPSAFE flag from the lower vnode's mount rather thanjhb2006-02-101-1/+1
| | | | | | | | always turning it on along with any flags set in the lower mount. Tested by: kris Reviewed by: jeff MFC after: 3 days
* - No need to WANTPARENT when we're just going to vrele it in a deadlockjeff2006-02-071-4/+1
| | | | | | | prone way later. Reported by: kkenn MFC After: 3 days
* Eradicate caddr_t from the VFS API.des2005-12-141-1/+1
|
* Normalize a significant number of kernel malloc type names:rwatson2005-10-312-3/+3
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Reflect mpsafety of the underlying filesystem in the nullfs image.kris2005-10-161-0/+1
| | | | | | | | | | I benchmarked this by simultaneously extracting 4 large tarballs (basically world images) on a 4-processor AMD64 system, in a malloc-backed md. With this patch, system time was reduced by 43%, and wall clock time by 33%. Submitted by: jeff MFC after: 1 week
* Handle a race condition where NULLFS vnode can be cleaned while threadskan2005-09-151-4/+28
| | | | | | | can still be asleep waiting for lowervp lock. Tested by: kkenn Discussed with: ssouhlal, jeffr
* Use vput() instead of vrele() in null_reclaim() since the lower vnodessouhlal2005-09-021-4/+5
| | | | | | is locked. MFC after: 3 days
* - As this is presently the one and only place where duplicate acquires ofjeff2005-04-221-1/+1
| | | | | | | the vnode interlock are allowed mark it by passing MTX_DUPOK to this lock operation only. Sponsored by: Isilon Systems, Inc.
* - Clear VI_OWEINACT before calling vget() with no lock type. We knowjeff2005-04-111-0/+7
| | | | | the node is actually already locked, and VOP_INACTIVE is not desirable in this case.
* - Honor the flags argument passed to null_root(). The filesystem belowjeff2005-04-111-1/+1
| | | | us will decide whether or not to grab a real shared lock.
* - Update vfs_root implementations to match the new prototype. None ofjeff2005-03-241-1/+2
| | | | | | | | these filesystems will support shared locks until they are explicitly modified to do so. Careful review must be done to ensure that this is safe for each individual filesystem. Sponsored by: Isilon Systems, Inc.
* - Lock the clearing of v_data so it is safe to inspect it with thejeff2005-03-171-1/+7
| | | | | | interlock. Sponsored by: Isilon Systems, Inc.
* - Assume that all lower filesystems now support proper locking. Assertjeff2005-03-153-190/+63
| | | | | | | | | | | | | | | | | that they set v->v_vnlock. This is true for all filesystems in the tree. - Remove all uses of LK_THISLAYER. If the lower layer is locked, the null layer is locked. We only use vget() to get a reference now. null essentially does no locking. This fixes LOOKUP_SHARED with nullfs. - Remove the special LK_DRAIN considerations, I do not believe this is needed now as LK_DRAIN doesn't destroy the lower vnode's lock, and it's hardly used anymore. - Add one well commented hack to prevent the lowervp from going away while we're in it's VOP_LOCK routine. This can only happen if we're forcibly unmounted while some callers are waiting in the lock. In this case the lowervp could be recycled after we drop our last ref in null_reclaim(). Prevent this with a vhold().
* - We have to transfer lockers after reseting our vnlock pointer.jeff2005-03-151-0/+5
| | | | Sponsored by: Isilon Systems, Inc.
* - The VI_DOOMED flag now signals the end of a vnode's relationship withjeff2005-03-132-12/+8
| | | | | | | | the filesystem. Check that rather than VI_XLOCK. - VOP_INACTIVE should no longer drop the vnode lock. - The vnode lock is required around calls to vrecycle() and vgone(). Sponsored by: Isilon Systems, Inc.
OpenPOWER on IntegriCloud