diff options
author | Fred Isaman <iisaman@netapp.com> | 2012-04-20 20:47:52 +0200 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 20:10:38 +0200 |
commit | 84c53ab5c093058c756dcef1879d38be6de90a3c (patch) | |
tree | 7ded11d20d02ad5df31d8f1246844ad069776d97 | |
parent | NFS: rewrite directio read to use async coalesce code (diff) | |
download | linux-84c53ab5c093058c756dcef1879d38be6de90a3c.tar.xz linux-84c53ab5c093058c756dcef1879d38be6de90a3c.zip |
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>
-rw-r--r-- | fs/nfs/write.c | 15 |
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 = { .rpc_release = nfs_commit_release, }; +static int nfs_generic_commit_list(struct inode *inode, struct list_head *head, + int how) +{ + int status; + + status = pnfs_commit_list(inode, head, how); + if (status == PNFS_NOT_ATTEMPTED) + status = nfs_commit_list(inode, head, how); + return status; +} + int nfs_commit_inode(struct inode *inode, int how) { LIST_HEAD(head); @@ -1536,9 +1547,7 @@ int nfs_commit_inode(struct inode *inode, int how) if (res) { int error; - error = pnfs_commit_list(inode, &head, how); - if (error == PNFS_NOT_ATTEMPTED) - error = nfs_commit_list(inode, &head, how); + error = nfs_generic_commit_list(inode, &head, how); if (error < 0) return error; if (!may_wait) |