summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-05-06 09:12:25 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-28 18:12:43 -0400
commit9137bdf3d241fc2cbeb2a8ced51d1546150aa6a1 (patch)
treebcce3aa0d097ec8eadd4ed61236dc452903f486c /fs/nfs
parent3c6b899c49e5e9c2803b59ee553eddaf69cea7f6 (diff)
NFS: Create a common results structure for reads and writes
Reads and writes have very similar results. This patch combines the two structs together with comments to show where the differing fields are used. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs2xdr.c6
-rw-r--r--fs/nfs/nfs3xdr.c8
-rw-r--r--fs/nfs/nfs4xdr.c9
-rw-r--r--fs/nfs/read.c2
-rw-r--r--fs/nfs/write.c2
5 files changed, 14 insertions, 13 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 461cd8bd9401..5f61b83f4a1c 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -103,7 +103,7 @@ static void print_overflow_msg(const char *func, const struct xdr_stream *xdr)
103/* 103/*
104 * typedef opaque nfsdata<>; 104 * typedef opaque nfsdata<>;
105 */ 105 */
106static int decode_nfsdata(struct xdr_stream *xdr, struct nfs_readres *result) 106static int decode_nfsdata(struct xdr_stream *xdr, struct nfs_pgio_res *result)
107{ 107{
108 u32 recvd, count; 108 u32 recvd, count;
109 __be32 *p; 109 __be32 *p;
@@ -857,7 +857,7 @@ out_default:
857 * }; 857 * };
858 */ 858 */
859static int nfs2_xdr_dec_readres(struct rpc_rqst *req, struct xdr_stream *xdr, 859static int nfs2_xdr_dec_readres(struct rpc_rqst *req, struct xdr_stream *xdr,
860 struct nfs_readres *result) 860 struct nfs_pgio_res *result)
861{ 861{
862 enum nfs_stat status; 862 enum nfs_stat status;
863 int error; 863 int error;
@@ -878,7 +878,7 @@ out_default:
878} 878}
879 879
880static int nfs2_xdr_dec_writeres(struct rpc_rqst *req, struct xdr_stream *xdr, 880static int nfs2_xdr_dec_writeres(struct rpc_rqst *req, struct xdr_stream *xdr,
881 struct nfs_writeres *result) 881 struct nfs_pgio_res *result)
882{ 882{
883 /* All NFSv2 writes are "file sync" writes */ 883 /* All NFSv2 writes are "file sync" writes */
884 result->verf->committed = NFS_FILE_SYNC; 884 result->verf->committed = NFS_FILE_SYNC;
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 02f16c212007..8f4cbe7f4aa8 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -1589,7 +1589,7 @@ out_default:
1589 * }; 1589 * };
1590 */ 1590 */
1591static int decode_read3resok(struct xdr_stream *xdr, 1591static int decode_read3resok(struct xdr_stream *xdr,
1592 struct nfs_readres *result) 1592 struct nfs_pgio_res *result)
1593{ 1593{
1594 u32 eof, count, ocount, recvd; 1594 u32 eof, count, ocount, recvd;
1595 __be32 *p; 1595 __be32 *p;
@@ -1625,7 +1625,7 @@ out_overflow:
1625} 1625}
1626 1626
1627static int nfs3_xdr_dec_read3res(struct rpc_rqst *req, struct xdr_stream *xdr, 1627static int nfs3_xdr_dec_read3res(struct rpc_rqst *req, struct xdr_stream *xdr,
1628 struct nfs_readres *result) 1628 struct nfs_pgio_res *result)
1629{ 1629{
1630 enum nfs_stat status; 1630 enum nfs_stat status;
1631 int error; 1631 int error;
@@ -1673,7 +1673,7 @@ out_status:
1673 * }; 1673 * };
1674 */ 1674 */
1675static int decode_write3resok(struct xdr_stream *xdr, 1675static int decode_write3resok(struct xdr_stream *xdr,
1676 struct nfs_writeres *result) 1676 struct nfs_pgio_res *result)
1677{ 1677{
1678 __be32 *p; 1678 __be32 *p;
1679 1679
@@ -1697,7 +1697,7 @@ out_eio:
1697} 1697}
1698 1698
1699static int nfs3_xdr_dec_write3res(struct rpc_rqst *req, struct xdr_stream *xdr, 1699static int nfs3_xdr_dec_write3res(struct rpc_rqst *req, struct xdr_stream *xdr,
1700 struct nfs_writeres *result) 1700 struct nfs_pgio_res *result)
1701{ 1701{
1702 enum nfs_stat status; 1702 enum nfs_stat status;
1703 int error; 1703 int error;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 032159c36a57..939ae606cfa4 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5087,7 +5087,8 @@ static int decode_putrootfh(struct xdr_stream *xdr)
5087 return decode_op_hdr(xdr, OP_PUTROOTFH); 5087 return decode_op_hdr(xdr, OP_PUTROOTFH);
5088} 5088}
5089 5089
5090static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res) 5090static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req,
5091 struct nfs_pgio_res *res)
5091{ 5092{
5092 __be32 *p; 5093 __be32 *p;
5093 uint32_t count, eof, recvd; 5094 uint32_t count, eof, recvd;
@@ -5341,7 +5342,7 @@ static int decode_setclientid_confirm(struct xdr_stream *xdr)
5341 return decode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM); 5342 return decode_op_hdr(xdr, OP_SETCLIENTID_CONFIRM);
5342} 5343}
5343 5344
5344static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res) 5345static int decode_write(struct xdr_stream *xdr, struct nfs_pgio_res *res)
5345{ 5346{
5346 __be32 *p; 5347 __be32 *p;
5347 int status; 5348 int status;
@@ -6638,7 +6639,7 @@ out:
6638 * Decode Read response 6639 * Decode Read response
6639 */ 6640 */
6640static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr, 6641static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6641 struct nfs_readres *res) 6642 struct nfs_pgio_res *res)
6642{ 6643{
6643 struct compound_hdr hdr; 6644 struct compound_hdr hdr;
6644 int status; 6645 int status;
@@ -6663,7 +6664,7 @@ out:
6663 * Decode WRITE response 6664 * Decode WRITE response
6664 */ 6665 */
6665static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr, 6666static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6666 struct nfs_writeres *res) 6667 struct nfs_pgio_res *res)
6667{ 6668{
6668 struct compound_hdr hdr; 6669 struct compound_hdr hdr;
6669 int status; 6670 int status;
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 46d555206023..473bba35a2cb 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -471,7 +471,7 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data)
471static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data) 471static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data)
472{ 472{
473 struct nfs_pgio_args *argp = &data->args; 473 struct nfs_pgio_args *argp = &data->args;
474 struct nfs_readres *resp = &data->res; 474 struct nfs_pgio_res *resp = &data->res;
475 475
476 /* This is a short read! */ 476 /* This is a short read! */
477 nfs_inc_stats(data->header->inode, NFSIOS_SHORTREAD); 477 nfs_inc_stats(data->header->inode, NFSIOS_SHORTREAD);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 25ba3830ec8b..d392a70092fe 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1389,7 +1389,7 @@ static int nfs_should_remove_suid(const struct inode *inode)
1389void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) 1389void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
1390{ 1390{
1391 struct nfs_pgio_args *argp = &data->args; 1391 struct nfs_pgio_args *argp = &data->args;
1392 struct nfs_writeres *resp = &data->res; 1392 struct nfs_pgio_res *resp = &data->res;
1393 struct inode *inode = data->header->inode; 1393 struct inode *inode = data->header->inode;
1394 int status; 1394 int status;
1395 1395