aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:52 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:38 -0400
commit84c53ab5c093058c756dcef1879d38be6de90a3c (patch)
tree7ded11d20d02ad5df31d8f1246844ad069776d97 /fs/nfs/write.c
parent584aa810b6240d88c28113a90c5029449814a3b5 (diff)
NFS: create nfs_generic_commit_list
Simple refactoring. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 705bf01cfbba..2500f1cf1996 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1523,6 +1523,17 @@ static const struct rpc_call_ops nfs_commit_ops = {
1523 .rpc_release = nfs_commit_release, 1523 .rpc_release = nfs_commit_release,
1524}; 1524};
1525 1525
1526static int nfs_generic_commit_list(struct inode *inode, struct list_head *head,
1527 int how)
1528{
1529 int status;
1530
1531 status = pnfs_commit_list(inode, head, how);
1532 if (status == PNFS_NOT_ATTEMPTED)
1533 status = nfs_commit_list(inode, head, how);
1534 return status;
1535}
1536
1526int nfs_commit_inode(struct inode *inode, int how) 1537int nfs_commit_inode(struct inode *inode, int how)
1527{ 1538{
1528 LIST_HEAD(head); 1539 LIST_HEAD(head);
@@ -1536,9 +1547,7 @@ int nfs_commit_inode(struct inode *inode, int how)
1536 if (res) { 1547 if (res) {
1537 int error; 1548 int error;
1538 1549
1539 error = pnfs_commit_list(inode, &head, how); 1550 error = nfs_generic_commit_list(inode, &head, how);
1540 if (error == PNFS_NOT_ATTEMPTED)
1541 error = nfs_commit_list(inode, &head, how);
1542 if (error < 0) 1551 if (error < 0)
1543 return error; 1552 return error;
1544 if (!may_wait) 1553 if (!may_wait)