diff options
author | jhb <jhb@FreeBSD.org> | 2010-08-20 19:46:50 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-08-20 19:46:50 +0000 |
commit | d4890c88b0febe402398e0a0bb66efdc998dd9c9 (patch) | |
tree | 9899b196d40cbc0b664fe2238a340bf770b2bd81 /sys/nfsclient | |
parent | a9738fb2b395d0c304c9a1fcf56a05f4143d9afb (diff) | |
download | FreeBSD-src-d4890c88b0febe402398e0a0bb66efdc998dd9c9.zip FreeBSD-src-d4890c88b0febe402398e0a0bb66efdc998dd9c9.tar.gz |
Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE and
LK_CANRECURSE after a lock is created. Use them to implement macros that
otherwise manipulated the flags directly. Assert that the associated
lockmgr lock is exclusively locked by the current thread when manipulating
these flags to ensure the flag updates are safe. This last change required
some minor shuffling in a few filesystems to exclusively lock a brand new
vnode slightly earlier.
Reviewed by: kib
MFC after: 3 days
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_node.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 947beed..9e558f4 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -150,6 +150,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int /* * NFS supports recursive and shared locking. */ + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); VN_LOCK_AREC(vp); VN_LOCK_ASHARE(vp); if (fhsize > NFS_SMALLFH) { @@ -158,7 +159,6 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); error = insmntque(vp, mntp); if (error != 0) { *npp = NULL; |