summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs/null_vnops.c
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
* 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@
* 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-231-1/+1
| | | | 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>
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-2/+1
| | | | | | | | | 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>
* 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-131-6/+4
| | | | | | | | | | | 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>
* This changes give nullfs correctly work with latest unionfs.daichi2007-10-141-5/+18
| | | | | | | 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-291-1/+0
| | | | | | kdb.h. Pointed out by: bde
* 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.
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-151-0/+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)
* - 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
* 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.
* - 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-151-130/+41
| | | | | | | | | | | | | | | | | 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-131-10/+6
| | | | | | | | 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.
* Introduce vx_wait{l}() and use it instead of home-rolled versions.phk2005-02-171-4/+2
|
* Remove vop_destroyvobject()phk2005-02-071-27/+1
|
* Make filesystems get rid of their own vnodes vnode_pager object inphk2005-01-281-0/+1
| | | | VOP_RECLAIM().
* Remove unused argument to vrecycle()phk2005-01-281-1/+1
|
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.phk2005-01-251-11/+0
|
* Don't implement vop_createvobject(), vop_open() and vop_close() managesphk2005-01-241-19/+0
| | | | this for nullfs now.
* Add null_open() and null_close() which calls null_bypass() and managedphk2005-01-241-0/+29
| | | | the v_object pointer.
* Kill the VV_OBJBUF and test the v_object for NULL instead.phk2005-01-241-2/+1
|
* Remove "register" keywords.phk2005-01-241-2/+2
|
* Style: Remove the commented out vop_foo_args replicas.phk2005-01-241-103/+15
|
* Change the generated VOP_ macro implementations to improve type checkingphk2005-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and KASSERT coverage. After this check there is only one "nasty" cast in this code but there is a KASSERT to protect against the wrong argument structure behind that cast. Un-inlining the meat of VOP_FOO() saves 35kB of text segment on a typical kernel with no change in performance. We also now run the checking and tracing on VOP's which have been layered by nullfs, umapfs, deadfs or unionfs. Add new (non-inline) VOP_FOO_AP() functions which take a "struct foo_args" argument and does everything the VOP_FOO() macros used to do with checks and debugging code. Add KASSERT to VOP_FOO_AP() check for argument type being correct. Slim down VOP_FOO() inline functions to just stuff arguments into the struct foo_args and call VOP_FOO_AP(). Put function pointer to VOP_FOO_AP() into vop_foo_desc structure and make VCALL() use it instead of the current offsetoff() hack. Retire vcall() which implemented the offsetoff() Make deadfs and unionfs use VOP_FOO_AP() calls instead of VCALL(), we know which specific call we want already. Remove unneeded arguments to VCALL() in nullfs and umapfs bypass functions. Remove unused vdesc_offset and VOFFSET(). Generally improve style/readability of the generated code.
* whitespacephk2005-01-101-1/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-011-27/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Mechanically change prototypes for vnode operations to use the new typedefs.phk2004-12-011-14/+14
|
* Eliminate null_open() and use instead null_bypass().phk2004-11-261-24/+0
| | | | | | | | Null_open() was only here to handle MNT_NODEV, but since that does not affect any filesystems anymore, it could only have any effect if you nullfs mounted a devfs but didn't want devices to show up. If you need that, there are easier ways.
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Don't try to unlock the directory vnode in null_lookup() if the lock istruckman2004-01-111-1/+1
| | | | | shared with the underlying file system and the lookup in the underlying file system did the unlock for us.
* v_vxproc was a bogus name for a thread (pointer).bde2003-12-281-2/+2
|
* MFp4: Fix two bugs causing possible deadlocks or panics, and one nit:tjr2003-06-171-4/+57
| | | | | | | | | | | | | | | | | | - Emulate lock draining (LK_DRAIN) in null_lock() to avoid deadlocks when the vnode is being recycled. - Don't allow null_nodeget() to return a nullfs vnode from the wrong mount when multiple nullfs's are mounted. It's unclear why these checks were removed in null_subr.c 1.35, but they are definitely necessary. Without the checks, trying to unmount a nullfs mount will erroneously return EBUSY, and forcibly unmounting with -f will cause a panic. - Bump LOG2_SIZEVNODE up to 8, since vnodes are >256 bytes now. The old value (7) didn't cause any problems, but made the hash algorithm suboptimal. These changes fix nullfs enough that a parallel buildworld succeeds. Submitted by: tegge (partially; LK_DRAIN) Tested by: kris
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-2/+1
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
OpenPOWER on IntegriCloud