aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:39 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:37 -0400
commit0b7c01533aa9f4a228d07d2768d084acb3a387bc (patch)
treeaa57b08ce42f1effea2294354e3c9770b70e7612 /include/linux
parent799ba8d53d32c84bd2a867ca2689538a48176140 (diff)
NFS: add a struct nfs_commit_data to replace nfs_write_data in commits
Commits don't need the vectors of pages, etc. that writes do. Split out a separate structure for the commit operation. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h4
-rw-r--r--include/linux/nfs_xdr.h45
2 files changed, 44 insertions, 5 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 52a1bdb4ee2b..d5d68f322bf0 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -552,8 +552,8 @@ extern int nfs_wb_page(struct inode *inode, struct page* page);
552extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 552extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
553#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 553#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
554extern int nfs_commit_inode(struct inode *, int); 554extern int nfs_commit_inode(struct inode *, int);
555extern struct nfs_write_data *nfs_commitdata_alloc(void); 555extern struct nfs_commit_data *nfs_commitdata_alloc(void);
556extern void nfs_commit_free(struct nfs_write_data *wdata); 556extern void nfs_commit_free(struct nfs_commit_data *data);
557#else 557#else
558static inline int 558static inline int
559nfs_commit_inode(struct inode *inode, int how) 559nfs_commit_inode(struct inode *inode, int how)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7ba3551a0414..8fb036a0d489 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -519,6 +519,24 @@ struct nfs_writeres {
519}; 519};
520 520
521/* 521/*
522 * Arguments to the commit call.
523 */
524struct nfs_commitargs {
525 struct nfs_fh *fh;
526 __u64 offset;
527 __u32 count;
528 const u32 *bitmask;
529 struct nfs4_sequence_args seq_args;
530};
531
532struct nfs_commitres {
533 struct nfs_fattr *fattr;
534 struct nfs_writeverf *verf;
535 const struct nfs_server *server;
536 struct nfs4_sequence_res seq_res;
537};
538
539/*
522 * Common arguments to the unlink call 540 * Common arguments to the unlink call
523 */ 541 */
524struct nfs_removeargs { 542struct nfs_removeargs {
@@ -1171,6 +1189,8 @@ struct nfs_read_data {
1171 struct page *page_array[NFS_PAGEVEC_SIZE]; 1189 struct page *page_array[NFS_PAGEVEC_SIZE];
1172}; 1190};
1173 1191
1192struct nfs_direct_req;
1193
1174struct nfs_write_data { 1194struct nfs_write_data {
1175 struct rpc_task task; 1195 struct rpc_task task;
1176 struct inode *inode; 1196 struct inode *inode;
@@ -1186,7 +1206,6 @@ struct nfs_write_data {
1186 struct nfs_writeres res; /* result struct */ 1206 struct nfs_writeres res; /* result struct */
1187 struct pnfs_layout_segment *lseg; 1207 struct pnfs_layout_segment *lseg;
1188 struct nfs_client *ds_clp; /* pNFS data server */ 1208 struct nfs_client *ds_clp; /* pNFS data server */
1189 int ds_commit_index;
1190 const struct rpc_call_ops *mds_ops; 1209 const struct rpc_call_ops *mds_ops;
1191 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); 1210 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1192#ifdef CONFIG_NFS_V4 1211#ifdef CONFIG_NFS_V4
@@ -1197,6 +1216,25 @@ struct nfs_write_data {
1197 struct page *page_array[NFS_PAGEVEC_SIZE]; 1216 struct page *page_array[NFS_PAGEVEC_SIZE];
1198}; 1217};
1199 1218
1219struct nfs_commit_data {
1220 struct rpc_task task;
1221 struct inode *inode;
1222 struct rpc_cred *cred;
1223 struct nfs_fattr fattr;
1224 struct nfs_writeverf verf;
1225 struct list_head pages; /* Coalesced requests we wish to flush */
1226 struct list_head list; /* lists of struct nfs_write_data */
1227 struct nfs_direct_req *dreq; /* O_DIRECT request */
1228 struct nfs_commitargs args; /* argument struct */
1229 struct nfs_commitres res; /* result struct */
1230 struct nfs_open_context *context;
1231 struct pnfs_layout_segment *lseg;
1232 struct nfs_client *ds_clp; /* pNFS data server */
1233 int ds_commit_index;
1234 const struct rpc_call_ops *mds_ops;
1235 int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
1236};
1237
1200struct nfs_unlinkdata { 1238struct nfs_unlinkdata {
1201 struct hlist_node list; 1239 struct hlist_node list;
1202 struct nfs_removeargs args; 1240 struct nfs_removeargs args;
@@ -1277,8 +1315,9 @@ struct nfs_rpc_ops {
1277 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1315 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1278 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); 1316 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
1279 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 1317 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1280 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); 1318 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
1281 int (*commit_done) (struct rpc_task *, struct nfs_write_data *); 1319 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1320 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1282 int (*lock)(struct file *, int, struct file_lock *); 1321 int (*lock)(struct file *, int, struct file_lock *);
1283 int (*lock_check_bounds)(const struct file_lock *); 1322 int (*lock_check_bounds)(const struct file_lock *);
1284 void (*clear_acl_cache)(struct inode *); 1323 void (*clear_acl_cache)(struct inode *);