Skip to content

Commit f755031

Browse files
Christoph HellwigAnna Schumaker
authored andcommitted
NFS: fold nfs_abort_delegation_return into nfs_end_delegation_return
This will allow to simplify the error handling flow. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
1 parent 438c3e4 commit f755031

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

fs/nfs/delegation.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -350,21 +350,6 @@ nfs_start_delegation_return(struct nfs_inode *nfsi)
350350
return delegation;
351351
}
352352

353-
static void nfs_abort_delegation_return(struct nfs_delegation *delegation,
354-
struct nfs_server *server, int err)
355-
{
356-
spin_lock(&delegation->lock);
357-
clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
358-
if (err == -EAGAIN) {
359-
set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags);
360-
set_bit(NFS4SERV_DELEGRETURN_DELAYED,
361-
&server->delegation_flags);
362-
set_bit(NFS4CLNT_DELEGRETURN_DELAYED,
363-
&server->nfs_client->cl_state);
364-
}
365-
spin_unlock(&delegation->lock);
366-
}
367-
368353
static bool
369354
nfs_detach_delegations_locked(struct nfs_inode *nfsi,
370355
struct nfs_delegation *delegation,
@@ -593,13 +578,23 @@ static int nfs_end_delegation_return(struct inode *inode,
593578
err = nfs4_wait_clnt_recover(server->nfs_client);
594579
}
595580

596-
if (err) {
597-
nfs_abort_delegation_return(delegation, server, err);
598-
return err;
599-
}
581+
if (err)
582+
goto abort;
600583

601584
out_return:
602585
return nfs_do_return_delegation(inode, delegation, issync);
586+
abort:
587+
spin_lock(&delegation->lock);
588+
clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
589+
if (err == -EAGAIN) {
590+
set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags);
591+
set_bit(NFS4SERV_DELEGRETURN_DELAYED,
592+
&server->delegation_flags);
593+
set_bit(NFS4CLNT_DELEGRETURN_DELAYED,
594+
&server->nfs_client->cl_state);
595+
}
596+
spin_unlock(&delegation->lock);
597+
return err;
603598
}
604599

605600
static int nfs_return_one_delegation(struct nfs_server *server)

0 commit comments

Comments
 (0)