Skip to content

Commit

Permalink
NFS: create nfs_generic_commit_list
Browse files Browse the repository at this point in the history
Simple refactoring.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Fred Isaman authored and Trond Myklebust committed Apr 27, 2012
1 parent 584aa81 commit 84c53ab
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 84c53ab

Please sign in to comment.