From 0d54671a48443b15ac601a80e192bc4c8faed7f9 Mon Sep 17 00:00:00 2001 From: attilio Date: Sun, 24 Feb 2008 16:38:58 +0000 Subject: Introduce some functions in the vnode locks namespace and in the ffs namespace in order to handle lockmgr fields in a controlled way instead than spreading all around bogus stubs: - VN_LOCK_AREC() allows lock recursion for a specified vnode - VN_LOCK_ASHARE() allows lock sharing for a specified vnode In FFS land: - BUF_AREC() allows lock recursion for a specified buffer lock - BUF_NOREC() disallows recursion for a specified buffer lock Side note: union_subr.c::unionfs_node_update() is the only other function directly handling lockmgr fields. As this is not simple to fix, it has been left behind as "sole" exception. --- sys/sys/vnode.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/sys/vnode.h') diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index abbc9e1..5c96a1c 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -400,6 +400,9 @@ extern void (*lease_updatetime)(int deltat); #define VI_UNLOCK(vp) mtx_unlock(&(vp)->v_interlock) #define VI_MTX(vp) (&(vp)->v_interlock) +#define VN_LOCK_AREC(vp) ((vp)->v_vnlock->lk_flags |= LK_CANRECURSE) +#define VN_LOCK_ASHARE(vp) ((vp)->v_vnlock->lk_flags &= ~LK_NOSHARE) + #endif /* _KERNEL */ /* -- cgit v1.1