diff options
author | attilio <attilio@FreeBSD.org> | 2008-02-24 16:38:58 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-02-24 16:38:58 +0000 |
commit | 0d54671a48443b15ac601a80e192bc4c8faed7f9 (patch) | |
tree | 997840c8acf28b15394b97f1d05d64f78bf81fd6 /sys/cddl | |
parent | 1c8346475e6e9a892928e5197425bb703eba2930 (diff) | |
download | FreeBSD-src-0d54671a48443b15ac601a80e192bc4c8faed7f9.zip FreeBSD-src-0d54671a48443b15ac601a80e192bc4c8faed7f9.tar.gz |
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.
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index a201837..46e501c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -119,8 +119,8 @@ zfs_znode_cache_constructor(void *buf, void *cdrarg, int kmflags) ASSERT(error == 0); zp->z_vnode = vp; vp->v_data = (caddr_t)zp; - vp->v_vnlock->lk_flags |= LK_CANRECURSE; - vp->v_vnlock->lk_flags &= ~LK_NOSHARE; + VN_LOCK_AREC(vp); + VN_LOCK_ASHARE(vp); } else { zp->z_vnode = NULL; } @@ -604,8 +604,8 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t **zpp) ASSERT(err == 0); vp = ZTOV(zp); vp->v_data = (caddr_t)zp; - vp->v_vnlock->lk_flags |= LK_CANRECURSE; - vp->v_vnlock->lk_flags &= ~LK_NOSHARE; + VN_LOCK_AREC(vp); + VN_LOCK_ASHARE(vp); vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode); if (vp->v_type == VDIR) zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */ |