Commit df821d2c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd: Open code exp_get and exp_get_fsid in the one place they are called.

parent 98b86145
...@@ -112,18 +112,6 @@ exp_get_key(svc_client *clp, dev_t dev, ino_t ino) ...@@ -112,18 +112,6 @@ exp_get_key(svc_client *clp, dev_t dev, ino_t ino)
return exp_find_key(clp, 0, fsidv); return exp_find_key(clp, 0, fsidv);
} }
static inline svc_export *
exp_get(svc_client *clp, dev_t dev, ino_t ino)
{
struct svc_expkey *ek;
ek = exp_get_key(clp, dev, ino);
if (ek)
return ek->ek_export;
else
return NULL;
}
/* /*
* Find the client's export entry matching fsid * Find the client's export entry matching fsid
*/ */
...@@ -137,18 +125,6 @@ exp_get_fsid_key(svc_client *clp, int fsid) ...@@ -137,18 +125,6 @@ exp_get_fsid_key(svc_client *clp, int fsid)
return exp_find_key(clp, 1, fsidv); return exp_find_key(clp, 1, fsidv);
} }
static inline svc_export *
exp_get_fsid(svc_client *clp, int fsid)
{
struct svc_expkey *ek;
ek = exp_get_fsid_key(clp, fsid);
if (ek)
return ek->ek_export;
else
return NULL;
}
svc_export * svc_export *
exp_get_by_name(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry) exp_get_by_name(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry)
{ {
...@@ -301,7 +277,7 @@ exp_export(struct nfsctl_export *nxp) ...@@ -301,7 +277,7 @@ exp_export(struct nfsctl_export *nxp)
{ {
svc_client *clp; svc_client *clp;
svc_export *exp = NULL; svc_export *exp = NULL;
svc_export *fsid_exp; struct svc_expkey *fsid_key;
struct nameidata nd; struct nameidata nd;
struct inode *inode = NULL; struct inode *inode = NULL;
int err; int err;
...@@ -335,8 +311,9 @@ exp_export(struct nfsctl_export *nxp) ...@@ -335,8 +311,9 @@ exp_export(struct nfsctl_export *nxp)
/* must make sure there wont be an ex_fsid clash */ /* must make sure there wont be an ex_fsid clash */
if ((nxp->ex_flags & NFSEXP_FSID) && if ((nxp->ex_flags & NFSEXP_FSID) &&
(fsid_exp = exp_get_fsid(clp, nxp->ex_dev)) && (fsid_key = exp_get_fsid_key(clp, nxp->ex_dev)) &&
fsid_exp != exp) fsid_key->ek_export &&
fsid_key->ek_export != exp)
goto finish; goto finish;
if (exp != NULL) { if (exp != NULL) {
...@@ -477,9 +454,9 @@ exp_unexport(struct nfsctl_export *nxp) ...@@ -477,9 +454,9 @@ exp_unexport(struct nfsctl_export *nxp)
dom = auth_domain_find(nxp->ex_client); dom = auth_domain_find(nxp->ex_client);
if (dom) { if (dom) {
svc_export *exp = exp_get(dom, nxp->ex_dev, nxp->ex_ino); struct svc_expkey *key = exp_get_key(dom, nxp->ex_dev, nxp->ex_ino);
if (exp) { if (key && key->ek_export) {
exp_do_unexport(exp); exp_do_unexport(key->ek_export);
err = 0; err = 0;
} else } else
dprintk("nfsd: no export %x/%lx for %s\n", dprintk("nfsd: no export %x/%lx for %s\n",
...@@ -547,14 +524,15 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize) ...@@ -547,14 +524,15 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
int int
exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp) exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp)
{ {
struct svc_export *exp; struct svc_expkey *fsid_key;
exp = exp_get_fsid(clp, 0); fsid_key = exp_get_fsid_key(clp, 0);
if (!exp) if (!fsid_key || IS_ERR(fsid_key))
return nfserr_perm; return nfserr_perm;
dget(exp->ex_dentry); dget(fsid_key->ek_export->ex_dentry);
return fh_compose(fhp, exp, exp->ex_dentry, NULL); return fh_compose(fhp, fsid_key->ek_export,
fsid_key->ek_export->ex_dentry, NULL);
} }
/* Iterator */ /* Iterator */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment