nfs_clport.c (322909) | nfs_clport.c (323142) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: stable/11/sys/fs/nfsclient/nfs_clport.c 322909 2017-08-25 22:52:40Z rmacklem $"); | 35__FBSDID("$FreeBSD: stable/11/sys/fs/nfsclient/nfs_clport.c 323142 2017-09-03 09:12:02Z kib $"); |
36 37#include "opt_inet.h" 38#include "opt_inet6.h" 39 40#include <sys/capsicum.h> 41 42/* 43 * generally, I don't like #includes inside .h files, but it seems to --- 181 unchanged lines hidden (view full) --- 225 np->n_vnode = vp; 226 /* 227 * Initialize the mutex even if the vnode is going to be a loser. 228 * This simplifies the logic in reclaim, which can then unconditionally 229 * destroy the mutex (in the case of the loser, or if hash_insert 230 * happened to return an error no special casing is needed). 231 */ 232 mtx_init(&np->n_mtx, "NEWNFSnode lock", NULL, MTX_DEF | MTX_DUPOK); | 36 37#include "opt_inet.h" 38#include "opt_inet6.h" 39 40#include <sys/capsicum.h> 41 42/* 43 * generally, I don't like #includes inside .h files, but it seems to --- 181 unchanged lines hidden (view full) --- 225 np->n_vnode = vp; 226 /* 227 * Initialize the mutex even if the vnode is going to be a loser. 228 * This simplifies the logic in reclaim, which can then unconditionally 229 * destroy the mutex (in the case of the loser, or if hash_insert 230 * happened to return an error no special casing is needed). 231 */ 232 mtx_init(&np->n_mtx, "NEWNFSnode lock", NULL, MTX_DEF | MTX_DUPOK); |
233 lockinit(&np->n_excl, PVFS, "nfsupg", VLKTIMEOUT, LK_NOSHARE | 234 LK_CANRECURSE); |
|
233 234 /* 235 * Are we getting the root? If so, make sure the vnode flags 236 * are correct 237 */ 238 if ((nfhp->nfh_len == nmp->nm_fhsize) && 239 !bcmp(nfhp->nfh_fh, nmp->nm_fh, nfhp->nfh_len)) { 240 if (vp->v_type == VNON) --- 25 unchanged lines hidden (view full) --- 266 */ 267 lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); 268 VN_LOCK_AREC(vp); 269 VN_LOCK_ASHARE(vp); 270 error = insmntque(vp, mntp); 271 if (error != 0) { 272 *npp = NULL; 273 mtx_destroy(&np->n_mtx); | 235 236 /* 237 * Are we getting the root? If so, make sure the vnode flags 238 * are correct 239 */ 240 if ((nfhp->nfh_len == nmp->nm_fhsize) && 241 !bcmp(nfhp->nfh_fh, nmp->nm_fh, nfhp->nfh_len)) { 242 if (vp->v_type == VNON) --- 25 unchanged lines hidden (view full) --- 268 */ 269 lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); 270 VN_LOCK_AREC(vp); 271 VN_LOCK_ASHARE(vp); 272 error = insmntque(vp, mntp); 273 if (error != 0) { 274 *npp = NULL; 275 mtx_destroy(&np->n_mtx); |
276 lockdestroy(&np->n_excl); |
|
274 FREE((caddr_t)nfhp, M_NFSFH); 275 if (np->n_v4 != NULL) 276 FREE((caddr_t)np->n_v4, M_NFSV4NODE); 277 uma_zfree(newnfsnode_zone, np); 278 return (error); 279 } 280 error = vfs_hash_insert(vp, hash, lkflags, 281 td, &nvp, newnfs_vncmpf, nfhp); --- 1211 unchanged lines hidden --- | 277 FREE((caddr_t)nfhp, M_NFSFH); 278 if (np->n_v4 != NULL) 279 FREE((caddr_t)np->n_v4, M_NFSV4NODE); 280 uma_zfree(newnfsnode_zone, np); 281 return (error); 282 } 283 error = vfs_hash_insert(vp, hash, lkflags, 284 td, &nvp, newnfs_vncmpf, nfhp); --- 1211 unchanged lines hidden --- |