NFSv4: Clean up delegation recall error handling
Unify the error handling in nfs4_open_delegation_recall and nfs4_lock_delegation_recall. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
be76b5b68d
commit
db4f2e637f
3 changed files with 29 additions and 58 deletions
|
@ -64,7 +64,7 @@ int nfs4_have_delegation(struct inode *inode, fmode_t flags)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_state *state)
|
||||
static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid)
|
||||
{
|
||||
struct inode *inode = state->inode;
|
||||
struct file_lock *fl;
|
||||
|
@ -83,7 +83,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
|
|||
if (nfs_file_open_context(fl->fl_file) != ctx)
|
||||
continue;
|
||||
unlock_flocks();
|
||||
status = nfs4_lock_delegation_recall(state, fl);
|
||||
status = nfs4_lock_delegation_recall(fl, state, stateid);
|
||||
if (status < 0)
|
||||
goto out;
|
||||
lock_flocks();
|
||||
|
@ -120,7 +120,7 @@ again:
|
|||
seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);
|
||||
err = nfs4_open_delegation_recall(ctx, state, stateid);
|
||||
if (!err)
|
||||
err = nfs_delegation_claim_locks(ctx, state);
|
||||
err = nfs_delegation_claim_locks(ctx, state, stateid);
|
||||
if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
|
||||
err = -EAGAIN;
|
||||
mutex_unlock(&sp->so_delegreturn_mutex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue