aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 13:48:18 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-01 15:42:44 -0400
commit7c317fcfbae773e493ecee1c53738db774b1d0ca (patch)
tree0d592d0244e1ef1ef59047574aceaebe17913e2e /fs/nfs/nfs4xdr.c
parent90ff0c548d1220d31f80e498b587393895705e6c (diff)
NFSv4: Simplify the NFSv4 CREATE compound
Get rid of the post-op GETATTR on the directory in order to reduce the amount of processing done on the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 6e878dcc0d2d..1a70097a8dc7 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -647,20 +647,14 @@ static int nfs4_stat_to_errno(int);
647#define NFS4_enc_create_sz (compound_encode_hdr_maxsz + \ 647#define NFS4_enc_create_sz (compound_encode_hdr_maxsz + \
648 encode_sequence_maxsz + \ 648 encode_sequence_maxsz + \
649 encode_putfh_maxsz + \ 649 encode_putfh_maxsz + \
650 encode_savefh_maxsz + \
651 encode_create_maxsz + \ 650 encode_create_maxsz + \
652 encode_getfh_maxsz + \ 651 encode_getfh_maxsz + \
653 encode_getattr_maxsz + \
654 encode_restorefh_maxsz + \
655 encode_getattr_maxsz) 652 encode_getattr_maxsz)
656#define NFS4_dec_create_sz (compound_decode_hdr_maxsz + \ 653#define NFS4_dec_create_sz (compound_decode_hdr_maxsz + \
657 decode_sequence_maxsz + \ 654 decode_sequence_maxsz + \
658 decode_putfh_maxsz + \ 655 decode_putfh_maxsz + \
659 decode_savefh_maxsz + \
660 decode_create_maxsz + \ 656 decode_create_maxsz + \
661 decode_getfh_maxsz + \ 657 decode_getfh_maxsz + \
662 decode_getattr_maxsz + \
663 decode_restorefh_maxsz + \
664 decode_getattr_maxsz) 658 decode_getattr_maxsz)
665#define NFS4_enc_pathconf_sz (compound_encode_hdr_maxsz + \ 659#define NFS4_enc_pathconf_sz (compound_encode_hdr_maxsz + \
666 encode_sequence_maxsz + \ 660 encode_sequence_maxsz + \
@@ -2119,12 +2113,9 @@ static void nfs4_xdr_enc_create(struct rpc_rqst *req, struct xdr_stream *xdr,
2119 encode_compound_hdr(xdr, req, &hdr); 2113 encode_compound_hdr(xdr, req, &hdr);
2120 encode_sequence(xdr, &args->seq_args, &hdr); 2114 encode_sequence(xdr, &args->seq_args, &hdr);
2121 encode_putfh(xdr, args->dir_fh, &hdr); 2115 encode_putfh(xdr, args->dir_fh, &hdr);
2122 encode_savefh(xdr, &hdr);
2123 encode_create(xdr, args, &hdr); 2116 encode_create(xdr, args, &hdr);
2124 encode_getfh(xdr, &hdr); 2117 encode_getfh(xdr, &hdr);
2125 encode_getfattr(xdr, args->bitmask, &hdr); 2118 encode_getfattr(xdr, args->bitmask, &hdr);
2126 encode_restorefh(xdr, &hdr);
2127 encode_getfattr(xdr, args->bitmask, &hdr);
2128 encode_nops(&hdr); 2119 encode_nops(&hdr);
2129} 2120}
2130 2121
@@ -5895,21 +5886,13 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5895 status = decode_putfh(xdr); 5886 status = decode_putfh(xdr);
5896 if (status) 5887 if (status)
5897 goto out; 5888 goto out;
5898 status = decode_savefh(xdr);
5899 if (status)
5900 goto out;
5901 status = decode_create(xdr, &res->dir_cinfo); 5889 status = decode_create(xdr, &res->dir_cinfo);
5902 if (status) 5890 if (status)
5903 goto out; 5891 goto out;
5904 status = decode_getfh(xdr, res->fh); 5892 status = decode_getfh(xdr, res->fh);
5905 if (status) 5893 if (status)
5906 goto out; 5894 goto out;
5907 if (decode_getfattr(xdr, res->fattr, res->server)) 5895 decode_getfattr(xdr, res->fattr, res->server);
5908 goto out;
5909 status = decode_restorefh(xdr);
5910 if (status)
5911 goto out;
5912 decode_getfattr(xdr, res->dir_fattr, res->server);
5913out: 5896out:
5914 return status; 5897 return status;
5915} 5898}