Skip to content

Commit 84c53ab

Browse files
Fred IsamanTrond Myklebust
authored andcommitted
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>
1 parent 584aa81 commit 84c53ab

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

fs/nfs/write.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,17 @@ static const struct rpc_call_ops nfs_commit_ops = {
15231523
.rpc_release = nfs_commit_release,
15241524
};
15251525

1526+
static 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+
15261537
int nfs_commit_inode(struct inode *inode, int how)
15271538
{
15281539
LIST_HEAD(head);
@@ -1536,9 +1547,7 @@ int nfs_commit_inode(struct inode *inode, int how)
15361547
if (res) {
15371548
int error;
15381549

1539-
error = pnfs_commit_list(inode, &head, how);
1540-
if (error == PNFS_NOT_ATTEMPTED)
1541-
error = nfs_commit_list(inode, &head, how);
1550+
error = nfs_generic_commit_list(inode, &head, how);
15421551
if (error < 0)
15431552
return error;
15441553
if (!may_wait)

0 commit comments

Comments
 (0)