Skip to content

Commit

Permalink
NFSD: Using exp_get for export getting
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kinglongmee authored and J. Bruce Fields committed Jun 23, 2014
1 parent 0da22a9 commit bf18f16
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ static int e_show(struct seq_file *m, void *p)
return 0;
}

cache_get(&exp->h);
exp_get(exp);
if (cache_check(cd, &exp->h, NULL))
return 0;
exp_put(exp);
Expand Down
3 changes: 2 additions & 1 deletion fs/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ static inline void exp_put(struct svc_export *exp)
cache_put(&exp->h, exp->cd);
}

static inline void exp_get(struct svc_export *exp)
static inline struct svc_export *exp_get(struct svc_export *exp)
{
cache_get(&exp->h);
return exp;
}
struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);

Expand Down
6 changes: 3 additions & 3 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
fh_put(dst);
dget(src->fh_dentry);
if (src->fh_export)
cache_get(&src->fh_export->h);
exp_get(src->fh_export);
*dst = *src;
}

Expand Down Expand Up @@ -918,8 +918,8 @@ nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstat
default:
return nfserr_inval;
}
exp_get(cstate->current_fh.fh_export);
sin->sin_exp = cstate->current_fh.fh_export;

sin->sin_exp = exp_get(cstate->current_fh.fh_export);
fh_put(&cstate->current_fh);
return nfs_ok;
}
Expand Down
3 changes: 1 addition & 2 deletions fs/nfsd/nfsfh.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
dentry);

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

if (fhp->fh_handle.fh_version == 0xca) {
/* old style filehandle please */
Expand Down
3 changes: 1 addition & 2 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,
dprintk("nfsd: nfsd_lookup(fh %s, %.*s)\n", SVCFH_fmt(fhp), len,name);

dparent = fhp->fh_dentry;
exp = fhp->fh_export;
exp_get(exp);
exp = exp_get(fhp->fh_export);

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

0 comments on commit bf18f16

Please sign in to comment.