Deleted Added
sdiff udiff text old ( 265466 ) new ( 265469 )
full compact
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/10/sys/fs/nfsclient/nfs_clrpcops.c 265466 2014-05-06 21:47:43Z rmacklem $");
36
37/*
38 * Rpc op calls, generally called from the vnode op calls or through the
39 * buffer cache, for NFS v2, 3 and 4.
40 * These do not normally make any changes to vnode arguments or use
41 * structures that might change between the VFS variants. The returned
42 * arguments are all at the end, after the NFSPROC_T *p one.
43 */

--- 2496 unchanged lines hidden (view full) ---

2540 struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap,
2541 struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp,
2542 int *dattrflagp, void *dstuff)
2543{
2544 u_int32_t *tl;
2545 struct nfsrv_descript nfsd, *nd = &nfsd;
2546 nfsattrbit_t attrbits;
2547 int error = 0;
2548
2549 *nfhpp = NULL;
2550 *attrflagp = 0;
2551 *dattrflagp = 0;
2552 if (namelen > NFS_MAXNAMLEN)
2553 return (ENAMETOOLONG);
2554 NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp);
2555 if (nd->nd_flag & ND_NFSV4) {
2556 NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
2557 *tl = txdr_unsigned(NFDIR);
2558 }
2559 (void) nfsm_strtom(nd, name, namelen);
2560 nfscl_fillsattr(nd, vap, dvp, NFSSATTR_SIZENEG1, 0);
2561 if (nd->nd_flag & ND_NFSV4) {
2562 NFSGETATTR_ATTRBIT(&attrbits);
2563 NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
2564 *tl++ = txdr_unsigned(NFSV4OP_GETFH);
2565 *tl = txdr_unsigned(NFSV4OP_GETATTR);
2566 (void) nfsrv_putattrbit(nd, &attrbits);
2567 }
2568 error = nfscl_request(nd, dvp, p, cred, dstuff);
2569 if (error)
2570 return (error);
2571 if (nd->nd_flag & ND_NFSV4)
2572 error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff);
2573 if (!nd->nd_repstat && !error) {
2574 if (nd->nd_flag & ND_NFSV4) {
2575 NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
2576 error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL);
2577 }
2578 if (!error)
2579 error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp);
2580 }
2581 if ((nd->nd_flag & ND_NFSV3) && !error)
2582 error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff);
2583 if (nd->nd_repstat && !error)
2584 error = nd->nd_repstat;
2585nfsmout:
2586 mbuf_freem(nd->nd_mrep);
2587 /*

--- 3309 unchanged lines hidden ---