aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:54 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:38 -0400
commitf453a54a01c7c0453ad9550906e3d2663dd486ac (patch)
tree1eac38e7e186ea0339066e7da417a20e0274b2c0 /fs/nfs/nfs4filelayout.c
parentea2cf2282b4278461266013e9c002ee1c66700ff (diff)
NFS: create nfs_commit_completion_ops
Factors out the code that needs to change when directio starts using these code paths. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index fe2cb55ca6b1..26d1da486761 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -347,12 +347,8 @@ static void filelayout_commit_count_stats(struct rpc_task *task, void *data)
347static void filelayout_commit_release(void *calldata) 347static void filelayout_commit_release(void *calldata)
348{ 348{
349 struct nfs_commit_data *data = calldata; 349 struct nfs_commit_data *data = calldata;
350 struct nfs_commit_info cinfo;
351 350
352 nfs_commit_release_pages(data); 351 data->completion_ops->completion(data);
353 nfs_init_cinfo(&cinfo, data->inode, data->dreq);
354 if (atomic_dec_and_test(&cinfo.mds->rpcs_out))
355 nfs_commit_clear_lock(NFS_I(data->inode));
356 put_lseg(data->lseg); 352 put_lseg(data->lseg);
357 nfs_commitdata_release(data); 353 nfs_commitdata_release(data);
358} 354}
@@ -1108,7 +1104,7 @@ filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
1108 nreq += alloc_ds_commits(cinfo, &list); 1104 nreq += alloc_ds_commits(cinfo, &list);
1109 1105
1110 if (nreq == 0) { 1106 if (nreq == 0) {
1111 nfs_commit_clear_lock(NFS_I(inode)); 1107 cinfo->completion_ops->error_cleanup(NFS_I(inode));
1112 goto out; 1108 goto out;
1113 } 1109 }
1114 1110
@@ -1117,14 +1113,14 @@ filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
1117 list_for_each_entry_safe(data, tmp, &list, pages) { 1113 list_for_each_entry_safe(data, tmp, &list, pages) {
1118 list_del_init(&data->pages); 1114 list_del_init(&data->pages);
1119 if (!data->lseg) { 1115 if (!data->lseg) {
1120 nfs_init_commit(data, mds_pages, NULL); 1116 nfs_init_commit(data, mds_pages, NULL, cinfo);
1121 nfs_initiate_commit(NFS_CLIENT(inode), data, 1117 nfs_initiate_commit(NFS_CLIENT(inode), data,
1122 data->mds_ops, how); 1118 data->mds_ops, how);
1123 } else { 1119 } else {
1124 struct pnfs_commit_bucket *buckets; 1120 struct pnfs_commit_bucket *buckets;
1125 1121
1126 buckets = cinfo->ds->buckets; 1122 buckets = cinfo->ds->buckets;
1127 nfs_init_commit(data, &buckets[data->ds_commit_index].committing, data->lseg); 1123 nfs_init_commit(data, &buckets[data->ds_commit_index].committing, data->lseg, cinfo);
1128 filelayout_initiate_commit(data, how); 1124 filelayout_initiate_commit(data, how);
1129 } 1125 }
1130 } 1126 }