diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 13:48:18 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 15:42:44 -0400 |
commit | 7c317fcfbae773e493ecee1c53738db774b1d0ca (patch) | |
tree | 0d592d0244e1ef1ef59047574aceaebe17913e2e /fs/nfs | |
parent | 90ff0c548d1220d31f80e498b587393895705e6c (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')
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 19 |
2 files changed, 1 insertions, 22 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index f01c3d1b54b7..619bc1eb157b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2994,7 +2994,6 @@ struct nfs4_createdata { | |||
2994 | struct nfs4_create_res res; | 2994 | struct nfs4_create_res res; |
2995 | struct nfs_fh fh; | 2995 | struct nfs_fh fh; |
2996 | struct nfs_fattr fattr; | 2996 | struct nfs_fattr fattr; |
2997 | struct nfs_fattr dir_fattr; | ||
2998 | }; | 2997 | }; |
2999 | 2998 | ||
3000 | static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, | 2999 | static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, |
@@ -3018,9 +3017,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, | |||
3018 | data->res.server = server; | 3017 | data->res.server = server; |
3019 | data->res.fh = &data->fh; | 3018 | data->res.fh = &data->fh; |
3020 | data->res.fattr = &data->fattr; | 3019 | data->res.fattr = &data->fattr; |
3021 | data->res.dir_fattr = &data->dir_fattr; | ||
3022 | nfs_fattr_init(data->res.fattr); | 3020 | nfs_fattr_init(data->res.fattr); |
3023 | nfs_fattr_init(data->res.dir_fattr); | ||
3024 | } | 3021 | } |
3025 | return data; | 3022 | return data; |
3026 | } | 3023 | } |
@@ -3031,7 +3028,6 @@ static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_ | |||
3031 | &data->arg.seq_args, &data->res.seq_res, 1); | 3028 | &data->arg.seq_args, &data->res.seq_res, 1); |
3032 | if (status == 0) { | 3029 | if (status == 0) { |
3033 | update_changeattr(dir, &data->res.dir_cinfo); | 3030 | update_changeattr(dir, &data->res.dir_cinfo); |
3034 | nfs_post_op_update_inode(dir, data->res.dir_fattr); | ||
3035 | status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); | 3031 | status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); |
3036 | } | 3032 | } |
3037 | return status; | 3033 | return status; |
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); | ||
5913 | out: | 5896 | out: |
5914 | return status; | 5897 | return status; |
5915 | } | 5898 | } |