aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:44 -0400
commit4f9838c7ecd14f31f701f64fa65ded132fc0db8a (patch)
treef3fee5b744efb072f44591208541554976bf41d7 /fs/nfs/nfs4xdr.c
parent16e429596dec4d28e16812b3a9be27f18412c567 (diff)
NFSv4: Add post-op attributes to NFSv4 write and commit callbacks.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 3ee3a1669d28..6f1bf182e0e0 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -159,16 +159,20 @@ static int nfs_stat_to_errno(int);
159 op_decode_hdr_maxsz + 2) 159 op_decode_hdr_maxsz + 2)
160#define NFS4_enc_write_sz (compound_encode_hdr_maxsz + \ 160#define NFS4_enc_write_sz (compound_encode_hdr_maxsz + \
161 encode_putfh_maxsz + \ 161 encode_putfh_maxsz + \
162 op_encode_hdr_maxsz + 8) 162 op_encode_hdr_maxsz + 8 + \
163 encode_getattr_maxsz)
163#define NFS4_dec_write_sz (compound_decode_hdr_maxsz + \ 164#define NFS4_dec_write_sz (compound_decode_hdr_maxsz + \
164 decode_putfh_maxsz + \ 165 decode_putfh_maxsz + \
165 op_decode_hdr_maxsz + 4) 166 op_decode_hdr_maxsz + 4 + \
167 decode_getattr_maxsz)
166#define NFS4_enc_commit_sz (compound_encode_hdr_maxsz + \ 168#define NFS4_enc_commit_sz (compound_encode_hdr_maxsz + \
167 encode_putfh_maxsz + \ 169 encode_putfh_maxsz + \
168 op_encode_hdr_maxsz + 3) 170 op_encode_hdr_maxsz + 3 + \
171 encode_getattr_maxsz)
169#define NFS4_dec_commit_sz (compound_decode_hdr_maxsz + \ 172#define NFS4_dec_commit_sz (compound_decode_hdr_maxsz + \
170 decode_putfh_maxsz + \ 173 decode_putfh_maxsz + \
171 op_decode_hdr_maxsz + 2) 174 op_decode_hdr_maxsz + 2 + \
175 decode_getattr_maxsz)
172#define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \ 176#define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \
173 encode_putfh_maxsz + \ 177 encode_putfh_maxsz + \
174 op_encode_hdr_maxsz + \ 178 op_encode_hdr_maxsz + \
@@ -1799,7 +1803,7 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writ
1799{ 1803{
1800 struct xdr_stream xdr; 1804 struct xdr_stream xdr;
1801 struct compound_hdr hdr = { 1805 struct compound_hdr hdr = {
1802 .nops = 2, 1806 .nops = 3,
1803 }; 1807 };
1804 int status; 1808 int status;
1805 1809
@@ -1809,6 +1813,9 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writ
1809 if (status) 1813 if (status)
1810 goto out; 1814 goto out;
1811 status = encode_write(&xdr, args); 1815 status = encode_write(&xdr, args);
1816 if (status)
1817 goto out;
1818 status = encode_getfattr(&xdr, args->bitmask);
1812out: 1819out:
1813 return status; 1820 return status;
1814} 1821}
@@ -1820,7 +1827,7 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_wri
1820{ 1827{
1821 struct xdr_stream xdr; 1828 struct xdr_stream xdr;
1822 struct compound_hdr hdr = { 1829 struct compound_hdr hdr = {
1823 .nops = 2, 1830 .nops = 3,
1824 }; 1831 };
1825 int status; 1832 int status;
1826 1833
@@ -1830,6 +1837,9 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_wri
1830 if (status) 1837 if (status)
1831 goto out; 1838 goto out;
1832 status = encode_commit(&xdr, args); 1839 status = encode_commit(&xdr, args);
1840 if (status)
1841 goto out;
1842 status = encode_getfattr(&xdr, args->bitmask);
1833out: 1843out:
1834 return status; 1844 return status;
1835} 1845}
@@ -4001,6 +4011,9 @@ static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_wr
4001 if (status) 4011 if (status)
4002 goto out; 4012 goto out;
4003 status = decode_write(&xdr, res); 4013 status = decode_write(&xdr, res);
4014 if (status)
4015 goto out;
4016 decode_getfattr(&xdr, res->fattr, res->server);
4004 if (!status) 4017 if (!status)
4005 status = res->count; 4018 status = res->count;
4006out: 4019out:
@@ -4024,6 +4037,9 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_w
4024 if (status) 4037 if (status)
4025 goto out; 4038 goto out;
4026 status = decode_commit(&xdr, res); 4039 status = decode_commit(&xdr, res);
4040 if (status)
4041 goto out;
4042 decode_getfattr(&xdr, res->fattr, res->server);
4027out: 4043out:
4028 return status; 4044 return status;
4029} 4045}