aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:38 -0400
commitea2cf2282b4278461266013e9c002ee1c66700ff (patch)
tree244de055925710de27206ee0d5d09caa6353bd62 /include/linux
parent84c53ab5c093058c756dcef1879d38be6de90a3c (diff)
NFS: create struct nfs_commit_info
It is COMMIT that is handled the most differently between the paged and direct paths. Create a structure that encapsulates everything either path needs to know about the commit state. We could use void to hide some of the layout driver stuff, but Trond suggests pulling it out to ensure type checking, given the huge changes being made, and the fact that it doesn't interfere with other drivers. 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.h5
-rw-r--r--include/linux/nfs_xdr.h27
2 files changed, 28 insertions, 4 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8d3a2b804201..8a88c16662c5 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -179,8 +179,7 @@ struct nfs_inode {
179 __be32 cookieverf[2]; 179 __be32 cookieverf[2];
180 180
181 unsigned long npages; 181 unsigned long npages;
182 unsigned long ncommit; 182 struct nfs_mds_commit_info commit_info;
183 struct list_head commit_list;
184 183
185 /* Open contexts for shared mmap writes */ 184 /* Open contexts for shared mmap writes */
186 struct list_head open_files; 185 struct list_head open_files;
@@ -201,7 +200,6 @@ struct nfs_inode {
201 200
202 /* pNFS layout information */ 201 /* pNFS layout information */
203 struct pnfs_layout_hdr *layout; 202 struct pnfs_layout_hdr *layout;
204 atomic_t commits_outstanding;
205#endif /* CONFIG_NFS_V4*/ 203#endif /* CONFIG_NFS_V4*/
206#ifdef CONFIG_NFS_FSCACHE 204#ifdef CONFIG_NFS_FSCACHE
207 struct fscache_cookie *fscache; 205 struct fscache_cookie *fscache;
@@ -230,7 +228,6 @@ struct nfs_inode {
230#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 228#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
231#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 229#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
232#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 230#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
233#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
234#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ 231#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
235#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */ 232#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */
236 233
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 38687b87ca9b..224e1e82670c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1079,6 +1079,21 @@ struct nfstime4 {
1079}; 1079};
1080 1080
1081#ifdef CONFIG_NFS_V4_1 1081#ifdef CONFIG_NFS_V4_1
1082
1083struct pnfs_commit_bucket {
1084 struct list_head written;
1085 struct list_head committing;
1086 struct pnfs_layout_segment *wlseg;
1087 struct pnfs_layout_segment *clseg;
1088};
1089
1090struct pnfs_ds_commit_info {
1091 int nwritten;
1092 int ncommitting;
1093 int nbuckets;
1094 struct pnfs_commit_bucket *buckets;
1095};
1096
1082#define NFS4_EXCHANGE_ID_LEN (48) 1097#define NFS4_EXCHANGE_ID_LEN (48)
1083struct nfs41_exchange_id_args { 1098struct nfs41_exchange_id_args {
1084 struct nfs_client *client; 1099 struct nfs_client *client;
@@ -1242,6 +1257,18 @@ struct nfs_write_header {
1242 struct nfs_write_data rpc_data; 1257 struct nfs_write_data rpc_data;
1243}; 1258};
1244 1259
1260struct nfs_mds_commit_info {
1261 atomic_t rpcs_out;
1262 unsigned long ncommit;
1263 struct list_head list;
1264};
1265
1266struct nfs_commit_info {
1267 spinlock_t *lock;
1268 struct nfs_mds_commit_info *mds;
1269 struct pnfs_ds_commit_info *ds;
1270};
1271
1245struct nfs_commit_data { 1272struct nfs_commit_data {
1246 struct rpc_task task; 1273 struct rpc_task task;
1247 struct inode *inode; 1274 struct inode *inode;