Skip to content

Commit bbf936e

Browse files
jtlaytonchucklever
authored andcommitted
NFSD: drop fh argument from alloc_init_deleg
Currently, we pass the fh of the opened file down through several functions so that alloc_init_deleg can pass it to delegation_blocked. The filehandle of the open file is available in the nfs4_file however, so there's no need to pass it in a separate argument. Drop the argument from alloc_init_deleg, nfs4_open_delegation and nfs4_set_delegation. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent a11ada9 commit bbf936e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

fs/nfsd/nfs4state.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,6 @@ static void block_delegations(struct knfsd_fh *fh)
11311131

11321132
static struct nfs4_delegation *
11331133
alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp,
1134-
struct svc_fh *current_fh,
11351134
struct nfs4_clnt_odstate *odstate)
11361135
{
11371136
struct nfs4_delegation *dp;
@@ -1141,7 +1140,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp,
11411140
n = atomic_long_inc_return(&num_delegations);
11421141
if (n < 0 || n > max_delegations)
11431142
goto out_dec;
1144-
if (delegation_blocked(&current_fh->fh_handle))
1143+
if (delegation_blocked(&fp->fi_fhandle))
11451144
goto out_dec;
11461145
dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab, nfs4_free_deleg));
11471146
if (dp == NULL)
@@ -5290,7 +5289,7 @@ static int nfsd4_check_conflicting_opens(struct nfs4_client *clp,
52905289
}
52915290

52925291
static struct nfs4_delegation *
5293-
nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
5292+
nfs4_set_delegation(struct nfs4_client *clp,
52945293
struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate)
52955294
{
52965295
int status = 0;
@@ -5335,7 +5334,7 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
53355334
return ERR_PTR(status);
53365335

53375336
status = -ENOMEM;
5338-
dp = alloc_init_deleg(clp, fp, fh, odstate);
5337+
dp = alloc_init_deleg(clp, fp, odstate);
53395338
if (!dp)
53405339
goto out_delegees;
53415340

@@ -5403,8 +5402,7 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status)
54035402
* proper support for them.
54045403
*/
54055404
static void
5406-
nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open,
5407-
struct nfs4_ol_stateid *stp)
5405+
nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp)
54085406
{
54095407
struct nfs4_delegation *dp;
54105408
struct nfs4_openowner *oo = openowner(stp->st_stateowner);
@@ -5436,7 +5434,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open,
54365434
default:
54375435
goto out_no_deleg;
54385436
}
5439-
dp = nfs4_set_delegation(clp, fh, stp->st_stid.sc_file, stp->st_clnt_odstate);
5437+
dp = nfs4_set_delegation(clp, stp->st_stid.sc_file, stp->st_clnt_odstate);
54405438
if (IS_ERR(dp))
54415439
goto out_no_deleg;
54425440

@@ -5568,7 +5566,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
55685566
* Attempt to hand out a delegation. No error return, because the
55695567
* OPEN succeeds even if we fail.
55705568
*/
5571-
nfs4_open_delegation(current_fh, open, stp);
5569+
nfs4_open_delegation(open, stp);
55725570
nodeleg:
55735571
status = nfs_ok;
55745572
trace_nfsd_open(&stp->st_stid.sc_stateid);

0 commit comments

Comments
 (0)