diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-08 11:56:09 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-28 17:20:50 -0400 |
commit | 2f2c63bc221c5fcded24de2704575d0abf96b910 (patch) | |
tree | dacf9f2bdbd101de6525a53571f0f1e48a75902e /fs/nfs/nfs3xdr.c | |
parent | 98d9452448122486f81030c6c70f29471f65e1ce (diff) |
NFS: Cleanup - only store the write verifier in struct nfs_page
The 'committed' field is not needed once we have put the struct nfs_page
on the right list.
Also correct the type of the verifier: it is not an array of __be32, but
simply an 8 byte long opaque array.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3xdr.c')
-rw-r--r-- | fs/nfs/nfs3xdr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 5013bdd85ab9..6cbe89400dfc 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -325,14 +325,14 @@ static void encode_createverf3(struct xdr_stream *xdr, const __be32 *verifier) | |||
325 | memcpy(p, verifier, NFS3_CREATEVERFSIZE); | 325 | memcpy(p, verifier, NFS3_CREATEVERFSIZE); |
326 | } | 326 | } |
327 | 327 | ||
328 | static int decode_writeverf3(struct xdr_stream *xdr, __be32 *verifier) | 328 | static int decode_writeverf3(struct xdr_stream *xdr, struct nfs_write_verifier *verifier) |
329 | { | 329 | { |
330 | __be32 *p; | 330 | __be32 *p; |
331 | 331 | ||
332 | p = xdr_inline_decode(xdr, NFS3_WRITEVERFSIZE); | 332 | p = xdr_inline_decode(xdr, NFS3_WRITEVERFSIZE); |
333 | if (unlikely(p == NULL)) | 333 | if (unlikely(p == NULL)) |
334 | goto out_overflow; | 334 | goto out_overflow; |
335 | memcpy(verifier, p, NFS3_WRITEVERFSIZE); | 335 | memcpy(verifier->data, p, NFS3_WRITEVERFSIZE); |
336 | return 0; | 336 | return 0; |
337 | out_overflow: | 337 | out_overflow: |
338 | print_overflow_msg(__func__, xdr); | 338 | print_overflow_msg(__func__, xdr); |
@@ -1668,20 +1668,22 @@ static int decode_write3resok(struct xdr_stream *xdr, | |||
1668 | { | 1668 | { |
1669 | __be32 *p; | 1669 | __be32 *p; |
1670 | 1670 | ||
1671 | p = xdr_inline_decode(xdr, 4 + 4 + NFS3_WRITEVERFSIZE); | 1671 | p = xdr_inline_decode(xdr, 4 + 4); |
1672 | if (unlikely(p == NULL)) | 1672 | if (unlikely(p == NULL)) |
1673 | goto out_overflow; | 1673 | goto out_overflow; |
1674 | result->count = be32_to_cpup(p++); | 1674 | result->count = be32_to_cpup(p++); |
1675 | result->verf->committed = be32_to_cpup(p++); | 1675 | result->verf->committed = be32_to_cpup(p++); |
1676 | if (unlikely(result->verf->committed > NFS_FILE_SYNC)) | 1676 | if (unlikely(result->verf->committed > NFS_FILE_SYNC)) |
1677 | goto out_badvalue; | 1677 | goto out_badvalue; |
1678 | memcpy(result->verf->verifier, p, NFS3_WRITEVERFSIZE); | 1678 | if (decode_writeverf3(xdr, &result->verf->verifier)) |
1679 | goto out_eio; | ||
1679 | return result->count; | 1680 | return result->count; |
1680 | out_badvalue: | 1681 | out_badvalue: |
1681 | dprintk("NFS: bad stable_how value: %u\n", result->verf->committed); | 1682 | dprintk("NFS: bad stable_how value: %u\n", result->verf->committed); |
1682 | return -EIO; | 1683 | return -EIO; |
1683 | out_overflow: | 1684 | out_overflow: |
1684 | print_overflow_msg(__func__, xdr); | 1685 | print_overflow_msg(__func__, xdr); |
1686 | out_eio: | ||
1685 | return -EIO; | 1687 | return -EIO; |
1686 | } | 1688 | } |
1687 | 1689 | ||
@@ -2314,7 +2316,7 @@ static int nfs3_xdr_dec_commit3res(struct rpc_rqst *req, | |||
2314 | goto out; | 2316 | goto out; |
2315 | if (status != NFS3_OK) | 2317 | if (status != NFS3_OK) |
2316 | goto out_status; | 2318 | goto out_status; |
2317 | error = decode_writeverf3(xdr, result->verf->verifier); | 2319 | error = decode_writeverf3(xdr, &result->verf->verifier); |
2318 | out: | 2320 | out: |
2319 | return error; | 2321 | return error; |
2320 | out_status: | 2322 | out_status: |