nfs_clvnops.c (195943) | nfs_clvnops.c (196503) |
---|---|
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 --- 19 unchanged lines hidden (view full) --- 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 * from nfs_vnops.c 8.16 (Berkeley) 5/27/95 33 */ 34 35#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 --- 19 unchanged lines hidden (view full) --- 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 * from nfs_vnops.c 8.16 (Berkeley) 5/27/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 195943 2009-07-29 14:50:31Z rmacklem $"); | 36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 196503 2009-08-24 10:09:30Z zec $"); |
37 38/* 39 * vnode op calls for Sun NFS version 2, 3 and 4 40 */ 41 42#include "opt_inet.h" 43 44#include <sys/param.h> --- 1355 unchanged lines hidden (view full) --- 1400 /* For NFSv4, wait until any remove is done. */ 1401 mtx_lock(&dnp->n_mtx); 1402 while (NFSHASNFSV4(nmp) && (dnp->n_flag & NREMOVEINPROG)) { 1403 dnp->n_flag |= NREMOVEWANT; 1404 (void) msleep((caddr_t)dnp, &dnp->n_mtx, PZERO, "nfscrt", 0); 1405 } 1406 mtx_unlock(&dnp->n_mtx); 1407 | 37 38/* 39 * vnode op calls for Sun NFS version 2, 3 and 4 40 */ 41 42#include "opt_inet.h" 43 44#include <sys/param.h> --- 1355 unchanged lines hidden (view full) --- 1400 /* For NFSv4, wait until any remove is done. */ 1401 mtx_lock(&dnp->n_mtx); 1402 while (NFSHASNFSV4(nmp) && (dnp->n_flag & NREMOVEINPROG)) { 1403 dnp->n_flag |= NREMOVEWANT; 1404 (void) msleep((caddr_t)dnp, &dnp->n_mtx, PZERO, "nfscrt", 0); 1405 } 1406 mtx_unlock(&dnp->n_mtx); 1407 |
1408 CURVNET_SET(P_TO_VNET(&proc0)); | |
1409#ifdef INET | 1408#ifdef INET |
1409 CURVNET_SET(CRED_TO_VNET(cnp->cn_cred)); |
|
1410 IN_IFADDR_RLOCK(); 1411 if (!TAILQ_EMPTY(&V_in_ifaddrhead)) 1412 cverf.lval[0] = IA_SIN(TAILQ_FIRST(&V_in_ifaddrhead))->sin_addr.s_addr; 1413 else 1414#endif 1415 cverf.lval[0] = create_verf; 1416#ifdef INET 1417 IN_IFADDR_RUNLOCK(); | 1410 IN_IFADDR_RLOCK(); 1411 if (!TAILQ_EMPTY(&V_in_ifaddrhead)) 1412 cverf.lval[0] = IA_SIN(TAILQ_FIRST(&V_in_ifaddrhead))->sin_addr.s_addr; 1413 else 1414#endif 1415 cverf.lval[0] = create_verf; 1416#ifdef INET 1417 IN_IFADDR_RUNLOCK(); |
1418 CURVNET_RESTORE(); |
|
1418#endif 1419 cverf.lval[1] = ++create_verf; | 1419#endif 1420 cverf.lval[1] = ++create_verf; |
1420 CURVNET_RESTORE(); | |
1421 error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, 1422 vap, cverf, fmode, cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva, 1423 &nfhp, &attrflag, &dattrflag, NULL); 1424 if (!error) { 1425 if (nfhp == NULL) 1426 (void) nfsrpc_lookup(dvp, cnp->cn_nameptr, 1427 cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, 1428 &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, --- 1733 unchanged lines hidden --- | 1421 error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, 1422 vap, cverf, fmode, cnp->cn_cred, cnp->cn_thread, &dnfsva, &nfsva, 1423 &nfhp, &attrflag, &dattrflag, NULL); 1424 if (!error) { 1425 if (nfhp == NULL) 1426 (void) nfsrpc_lookup(dvp, cnp->cn_nameptr, 1427 cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, 1428 &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag, --- 1733 unchanged lines hidden --- |