aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-05-06 09:12:26 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-28 18:12:47 -0400
commit9c7e1b3d50b56b8d8f6237ed232350b7c6476cd5 (patch)
tree4113ef7dcdbf7b55139f7765d7dc1044d7c0fd83 /include/linux
parent9137bdf3d241fc2cbeb2a8ced51d1546150aa6a1 (diff)
NFS: Create a common read and write data struct
At this point, the only difference between nfs_read_data and nfs_write_data is the write verifier. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h4
-rw-r--r--include/linux/nfs_xdr.h44
2 files changed, 17 insertions, 31 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index fa6918b0f829..7e0db561d829 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -520,7 +520,7 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
520extern int nfs_writepages(struct address_space *, struct writeback_control *); 520extern int nfs_writepages(struct address_space *, struct writeback_control *);
521extern int nfs_flush_incompatible(struct file *file, struct page *page); 521extern int nfs_flush_incompatible(struct file *file, struct page *page);
522extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 522extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
523extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); 523extern void nfs_writeback_done(struct rpc_task *, struct nfs_pgio_data *);
524 524
525/* 525/*
526 * Try to write back everything synchronously (but check the 526 * Try to write back everything synchronously (but check the
@@ -553,7 +553,7 @@ nfs_have_writebacks(struct inode *inode)
553extern int nfs_readpage(struct file *, struct page *); 553extern int nfs_readpage(struct file *, struct page *);
554extern int nfs_readpages(struct file *, struct address_space *, 554extern int nfs_readpages(struct file *, struct address_space *,
555 struct list_head *, unsigned); 555 struct list_head *, unsigned);
556extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); 556extern int nfs_readpage_result(struct rpc_task *, struct nfs_pgio_data *);
557extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, 557extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
558 struct page *); 558 struct page *);
559 559
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 381f832b03c6..64f6f1491c0d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1247,20 +1247,6 @@ struct nfs_page_array {
1247 struct page *page_array[NFS_PAGEVEC_SIZE]; 1247 struct page *page_array[NFS_PAGEVEC_SIZE];
1248}; 1248};
1249 1249
1250struct nfs_read_data {
1251 struct nfs_pgio_header *header;
1252 struct list_head list;
1253 struct rpc_task task;
1254 struct nfs_fattr fattr; /* fattr storage */
1255 struct nfs_pgio_args args;
1256 struct nfs_pgio_res res;
1257 unsigned long timestamp; /* For lease renewal */
1258 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1259 __u64 mds_offset;
1260 struct nfs_page_array pages;
1261 struct nfs_client *ds_clp; /* pNFS data server */
1262};
1263
1264/* used as flag bits in nfs_pgio_header */ 1250/* used as flag bits in nfs_pgio_header */
1265enum { 1251enum {
1266 NFS_IOHDR_ERROR = 0, 1252 NFS_IOHDR_ERROR = 0,
@@ -1293,29 +1279,29 @@ struct nfs_pgio_header {
1293 unsigned long flags; 1279 unsigned long flags;
1294}; 1280};
1295 1281
1296struct nfs_read_header { 1282struct nfs_pgio_data {
1297 struct nfs_pgio_header header;
1298 struct nfs_read_data rpc_data;
1299};
1300
1301struct nfs_write_data {
1302 struct nfs_pgio_header *header; 1283 struct nfs_pgio_header *header;
1303 struct list_head list; 1284 struct list_head list;
1304 struct rpc_task task; 1285 struct rpc_task task;
1305 struct nfs_fattr fattr; 1286 struct nfs_fattr fattr;
1306 struct nfs_writeverf verf; 1287 struct nfs_writeverf verf; /* Used for writes */
1307 struct nfs_pgio_args args; /* argument struct */ 1288 struct nfs_pgio_args args; /* argument struct */
1308 struct nfs_pgio_res res; /* result struct */ 1289 struct nfs_pgio_res res; /* result struct */
1309 unsigned long timestamp; /* For lease renewal */ 1290 unsigned long timestamp; /* For lease renewal */
1310 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); 1291 int (*pgio_done_cb) (struct rpc_task *task, struct nfs_pgio_data *data);
1311 __u64 mds_offset; /* Filelayout dense stripe */ 1292 __u64 mds_offset; /* Filelayout dense stripe */
1312 struct nfs_page_array pages; 1293 struct nfs_page_array pages;
1313 struct nfs_client *ds_clp; /* pNFS data server */ 1294 struct nfs_client *ds_clp; /* pNFS data server */
1314}; 1295};
1315 1296
1297struct nfs_read_header {
1298 struct nfs_pgio_header header;
1299 struct nfs_pgio_data rpc_data;
1300};
1301
1316struct nfs_write_header { 1302struct nfs_write_header {
1317 struct nfs_pgio_header header; 1303 struct nfs_pgio_header header;
1318 struct nfs_write_data rpc_data; 1304 struct nfs_pgio_data rpc_data;
1319 struct nfs_writeverf verf; 1305 struct nfs_writeverf verf;
1320}; 1306};
1321 1307
@@ -1448,12 +1434,12 @@ struct nfs_rpc_ops {
1448 struct nfs_pathconf *); 1434 struct nfs_pathconf *);
1449 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1435 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1450 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); 1436 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1451 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1437 void (*read_setup) (struct nfs_pgio_data *, struct rpc_message *);
1452 int (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); 1438 int (*read_rpc_prepare)(struct rpc_task *, struct nfs_pgio_data *);
1453 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1439 int (*read_done) (struct rpc_task *, struct nfs_pgio_data *);
1454 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1440 void (*write_setup) (struct nfs_pgio_data *, struct rpc_message *);
1455 int (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); 1441 int (*write_rpc_prepare)(struct rpc_task *, struct nfs_pgio_data *);
1456 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 1442 int (*write_done) (struct rpc_task *, struct nfs_pgio_data *);
1457 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *); 1443 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
1458 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); 1444 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1459 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *); 1445 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);