switch exp_parent() to struct path
... and lose the always-NULL last argument (non-NULL case had been split off a while ago). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Родитель
55430e2ece
Коммит
5bf3bd2b5c
|
@ -871,23 +871,19 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
|
||||||
/*
|
/*
|
||||||
* Find the export entry for a given dentry.
|
* Find the export entry for a given dentry.
|
||||||
*/
|
*/
|
||||||
static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt,
|
static struct svc_export *exp_parent(svc_client *clp, struct path *path)
|
||||||
struct dentry *dentry,
|
|
||||||
struct cache_req *reqp)
|
|
||||||
{
|
{
|
||||||
struct path path = {.mnt = mnt, .dentry = dentry};
|
struct dentry *saved = dget(path->dentry);
|
||||||
svc_export *exp;
|
svc_export *exp = exp_get_by_name(clp, path, NULL);
|
||||||
|
|
||||||
dget(path.dentry);
|
while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
|
||||||
exp = exp_get_by_name(clp, &path, reqp);
|
struct dentry *parent = dget_parent(path->dentry);
|
||||||
|
dput(path->dentry);
|
||||||
while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) {
|
path->dentry = parent;
|
||||||
struct dentry *parent = dget_parent(path.dentry);
|
exp = exp_get_by_name(clp, path, NULL);
|
||||||
dput(path.dentry);
|
|
||||||
path.dentry = parent;
|
|
||||||
exp = exp_get_by_name(clp, &path, reqp);
|
|
||||||
}
|
}
|
||||||
dput(path.dentry);
|
dput(path->dentry);
|
||||||
|
path->dentry = saved;
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1174,7 +1170,7 @@ exp_rootfh(svc_client *clp, char *name, struct knfsd_fh *f, int maxsize)
|
||||||
dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n",
|
dprintk("nfsd: exp_rootfh(%s [%p] %s:%s/%ld)\n",
|
||||||
name, path.dentry, clp->name,
|
name, path.dentry, clp->name,
|
||||||
inode->i_sb->s_id, inode->i_ino);
|
inode->i_sb->s_id, inode->i_ino);
|
||||||
exp = exp_parent(clp, path.mnt, path.dentry, NULL);
|
exp = exp_parent(clp, &path);
|
||||||
if (IS_ERR(exp)) {
|
if (IS_ERR(exp)) {
|
||||||
err = PTR_ERR(exp);
|
err = PTR_ERR(exp);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче