diff options
author | Peng Tao <tao.peng@primarydata.com> | 2014-08-26 22:47:14 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:40 -0500 |
commit | aabff4ddcac0d36dd26546f5b905c27682e7bf89 (patch) | |
tree | b110bd135df2b9cab2bb7caf4f89566a60167a7b /fs/nfs | |
parent | 9bf87482ddc6f8db884177a2a16b1a1dc12f8777 (diff) |
nfs: save server READ/WRITE/COMMIT status
Flexfiles layout would want to use them to report DS IO status.
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs2xdr.c | 10 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 3 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 3 |
3 files changed, 13 insertions, 3 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 5f61b83f4a1c..b4e03ed8599d 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -481,7 +481,8 @@ out_overflow: | |||
481 | * void; | 481 | * void; |
482 | * }; | 482 | * }; |
483 | */ | 483 | */ |
484 | static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result) | 484 | static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result, |
485 | __u32 *op_status) | ||
485 | { | 486 | { |
486 | enum nfs_stat status; | 487 | enum nfs_stat status; |
487 | int error; | 488 | int error; |
@@ -489,6 +490,8 @@ static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result) | |||
489 | error = decode_stat(xdr, &status); | 490 | error = decode_stat(xdr, &status); |
490 | if (unlikely(error)) | 491 | if (unlikely(error)) |
491 | goto out; | 492 | goto out; |
493 | if (op_status) | ||
494 | *op_status = status; | ||
492 | if (status != NFS_OK) | 495 | if (status != NFS_OK) |
493 | goto out_default; | 496 | goto out_default; |
494 | error = decode_fattr(xdr, result); | 497 | error = decode_fattr(xdr, result); |
@@ -808,7 +811,7 @@ out_default: | |||
808 | static int nfs2_xdr_dec_attrstat(struct rpc_rqst *req, struct xdr_stream *xdr, | 811 | static int nfs2_xdr_dec_attrstat(struct rpc_rqst *req, struct xdr_stream *xdr, |
809 | struct nfs_fattr *result) | 812 | struct nfs_fattr *result) |
810 | { | 813 | { |
811 | return decode_attrstat(xdr, result); | 814 | return decode_attrstat(xdr, result, NULL); |
812 | } | 815 | } |
813 | 816 | ||
814 | static int nfs2_xdr_dec_diropres(struct rpc_rqst *req, struct xdr_stream *xdr, | 817 | static int nfs2_xdr_dec_diropres(struct rpc_rqst *req, struct xdr_stream *xdr, |
@@ -865,6 +868,7 @@ static int nfs2_xdr_dec_readres(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
865 | error = decode_stat(xdr, &status); | 868 | error = decode_stat(xdr, &status); |
866 | if (unlikely(error)) | 869 | if (unlikely(error)) |
867 | goto out; | 870 | goto out; |
871 | result->op_status = status; | ||
868 | if (status != NFS_OK) | 872 | if (status != NFS_OK) |
869 | goto out_default; | 873 | goto out_default; |
870 | error = decode_fattr(xdr, result->fattr); | 874 | error = decode_fattr(xdr, result->fattr); |
@@ -882,7 +886,7 @@ static int nfs2_xdr_dec_writeres(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
882 | { | 886 | { |
883 | /* All NFSv2 writes are "file sync" writes */ | 887 | /* All NFSv2 writes are "file sync" writes */ |
884 | result->verf->committed = NFS_FILE_SYNC; | 888 | result->verf->committed = NFS_FILE_SYNC; |
885 | return decode_attrstat(xdr, result->fattr); | 889 | return decode_attrstat(xdr, result->fattr, &result->op_status); |
886 | } | 890 | } |
887 | 891 | ||
888 | /** | 892 | /** |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 8f4cbe7f4aa8..2a932fdc57cb 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -1636,6 +1636,7 @@ static int nfs3_xdr_dec_read3res(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
1636 | error = decode_post_op_attr(xdr, result->fattr); | 1636 | error = decode_post_op_attr(xdr, result->fattr); |
1637 | if (unlikely(error)) | 1637 | if (unlikely(error)) |
1638 | goto out; | 1638 | goto out; |
1639 | result->op_status = status; | ||
1639 | if (status != NFS3_OK) | 1640 | if (status != NFS3_OK) |
1640 | goto out_status; | 1641 | goto out_status; |
1641 | error = decode_read3resok(xdr, result); | 1642 | error = decode_read3resok(xdr, result); |
@@ -1708,6 +1709,7 @@ static int nfs3_xdr_dec_write3res(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
1708 | error = decode_wcc_data(xdr, result->fattr); | 1709 | error = decode_wcc_data(xdr, result->fattr); |
1709 | if (unlikely(error)) | 1710 | if (unlikely(error)) |
1710 | goto out; | 1711 | goto out; |
1712 | result->op_status = status; | ||
1711 | if (status != NFS3_OK) | 1713 | if (status != NFS3_OK) |
1712 | goto out_status; | 1714 | goto out_status; |
1713 | error = decode_write3resok(xdr, result); | 1715 | error = decode_write3resok(xdr, result); |
@@ -2323,6 +2325,7 @@ static int nfs3_xdr_dec_commit3res(struct rpc_rqst *req, | |||
2323 | error = decode_wcc_data(xdr, result->fattr); | 2325 | error = decode_wcc_data(xdr, result->fattr); |
2324 | if (unlikely(error)) | 2326 | if (unlikely(error)) |
2325 | goto out; | 2327 | goto out; |
2328 | result->op_status = status; | ||
2326 | if (status != NFS3_OK) | 2329 | if (status != NFS3_OK) |
2327 | goto out_status; | 2330 | goto out_status; |
2328 | error = decode_writeverf3(xdr, &result->verf->verifier); | 2331 | error = decode_writeverf3(xdr, &result->verf->verifier); |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index cb4376b78ed9..7d8d7a47f771 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -6567,6 +6567,7 @@ static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6567 | int status; | 6567 | int status; |
6568 | 6568 | ||
6569 | status = decode_compound_hdr(xdr, &hdr); | 6569 | status = decode_compound_hdr(xdr, &hdr); |
6570 | res->op_status = hdr.status; | ||
6570 | if (status) | 6571 | if (status) |
6571 | goto out; | 6572 | goto out; |
6572 | status = decode_sequence(xdr, &res->seq_res, rqstp); | 6573 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
@@ -6592,6 +6593,7 @@ static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6592 | int status; | 6593 | int status; |
6593 | 6594 | ||
6594 | status = decode_compound_hdr(xdr, &hdr); | 6595 | status = decode_compound_hdr(xdr, &hdr); |
6596 | res->op_status = hdr.status; | ||
6595 | if (status) | 6597 | if (status) |
6596 | goto out; | 6598 | goto out; |
6597 | status = decode_sequence(xdr, &res->seq_res, rqstp); | 6599 | status = decode_sequence(xdr, &res->seq_res, rqstp); |
@@ -6621,6 +6623,7 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6621 | int status; | 6623 | int status; |
6622 | 6624 | ||
6623 | status = decode_compound_hdr(xdr, &hdr); | 6625 | status = decode_compound_hdr(xdr, &hdr); |
6626 | res->op_status = hdr.status; | ||
6624 | if (status) | 6627 | if (status) |
6625 | goto out; | 6628 | goto out; |
6626 | status = decode_sequence(xdr, &res->seq_res, rqstp); | 6629 | status = decode_sequence(xdr, &res->seq_res, rqstp); |