Skip to content

Commit bf18f16

Browse files
kinglongmeeJ. Bruce Fields
authored and
J. Bruce Fields
committed
NFSD: Using exp_get for export getting
Don't using cache_get besides export.h, using exp_get for export. Signed-off-by: Kinglong Mee <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 0da22a9 commit bf18f16

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

fs/nfsd/export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ static int e_show(struct seq_file *m, void *p)
12531253
return 0;
12541254
}
12551255

1256-
cache_get(&exp->h);
1256+
exp_get(exp);
12571257
if (cache_check(cd, &exp->h, NULL))
12581258
return 0;
12591259
exp_put(exp);

fs/nfsd/export.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ static inline void exp_put(struct svc_export *exp)
101101
cache_put(&exp->h, exp->cd);
102102
}
103103

104-
static inline void exp_get(struct svc_export *exp)
104+
static inline struct svc_export *exp_get(struct svc_export *exp)
105105
{
106106
cache_get(&exp->h);
107+
return exp;
107108
}
108109
struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
109110

fs/nfsd/nfs4proc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
177177
fh_put(dst);
178178
dget(src->fh_dentry);
179179
if (src->fh_export)
180-
cache_get(&src->fh_export->h);
180+
exp_get(src->fh_export);
181181
*dst = *src;
182182
}
183183

@@ -918,8 +918,8 @@ nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstat
918918
default:
919919
return nfserr_inval;
920920
}
921-
exp_get(cstate->current_fh.fh_export);
922-
sin->sin_exp = cstate->current_fh.fh_export;
921+
922+
sin->sin_exp = exp_get(cstate->current_fh.fh_export);
923923
fh_put(&cstate->current_fh);
924924
return nfs_ok;
925925
}

fs/nfsd/nfsfh.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
539539
dentry);
540540

541541
fhp->fh_dentry = dget(dentry); /* our internal copy */
542-
fhp->fh_export = exp;
543-
cache_get(&exp->h);
542+
fhp->fh_export = exp_get(exp);
544543

545544
if (fhp->fh_handle.fh_version == 0xca) {
546545
/* old style filehandle please */

fs/nfsd/vfs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,
189189
dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp), len,name);
190190

191191
dparent = fhp->fh_dentry;
192-
exp = fhp->fh_export;
193-
exp_get(exp);
192+
exp = exp_get(fhp->fh_export);
194193

195194
/* Lookup the name, but don't follow links */
196195
if (isdotent(name, len)) {

0 commit comments

Comments
 (0)