mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
[PATCH] knfsd: nfsd: store export path in export
Store the export path in the svc_export structure instead of storing only the dentry. This will prevent the need for additional d_path calls to provide NFSv4 fs_locations support. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
21c0d8fdd9
commit
b009a873de
2 changed files with 11 additions and 0 deletions
|
@ -325,6 +325,7 @@ static void svc_export_put(struct kref *ref)
|
||||||
dput(exp->ex_dentry);
|
dput(exp->ex_dentry);
|
||||||
mntput(exp->ex_mnt);
|
mntput(exp->ex_mnt);
|
||||||
auth_domain_put(exp->ex_client);
|
auth_domain_put(exp->ex_client);
|
||||||
|
kfree(exp->ex_path);
|
||||||
kfree(exp);
|
kfree(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,6 +399,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
|
||||||
int an_int;
|
int an_int;
|
||||||
|
|
||||||
nd.dentry = NULL;
|
nd.dentry = NULL;
|
||||||
|
exp.ex_path = NULL;
|
||||||
|
|
||||||
if (mesg[mlen-1] != '\n')
|
if (mesg[mlen-1] != '\n')
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -428,6 +430,10 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
|
||||||
exp.ex_client = dom;
|
exp.ex_client = dom;
|
||||||
exp.ex_mnt = nd.mnt;
|
exp.ex_mnt = nd.mnt;
|
||||||
exp.ex_dentry = nd.dentry;
|
exp.ex_dentry = nd.dentry;
|
||||||
|
exp.ex_path = kstrdup(buf, GFP_KERNEL);
|
||||||
|
err = -ENOMEM;
|
||||||
|
if (!exp.ex_path)
|
||||||
|
goto out;
|
||||||
|
|
||||||
/* expiry */
|
/* expiry */
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
@ -473,6 +479,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
|
||||||
else
|
else
|
||||||
exp_put(expp);
|
exp_put(expp);
|
||||||
out:
|
out:
|
||||||
|
kfree(exp.ex_path);
|
||||||
if (nd.dentry)
|
if (nd.dentry)
|
||||||
path_release(&nd);
|
path_release(&nd);
|
||||||
out_no_path:
|
out_no_path:
|
||||||
|
@ -524,6 +531,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
|
||||||
new->ex_client = item->ex_client;
|
new->ex_client = item->ex_client;
|
||||||
new->ex_dentry = dget(item->ex_dentry);
|
new->ex_dentry = dget(item->ex_dentry);
|
||||||
new->ex_mnt = mntget(item->ex_mnt);
|
new->ex_mnt = mntget(item->ex_mnt);
|
||||||
|
new->ex_path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void export_update(struct cache_head *cnew, struct cache_head *citem)
|
static void export_update(struct cache_head *cnew, struct cache_head *citem)
|
||||||
|
@ -535,6 +543,8 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem)
|
||||||
new->ex_anon_uid = item->ex_anon_uid;
|
new->ex_anon_uid = item->ex_anon_uid;
|
||||||
new->ex_anon_gid = item->ex_anon_gid;
|
new->ex_anon_gid = item->ex_anon_gid;
|
||||||
new->ex_fsid = item->ex_fsid;
|
new->ex_fsid = item->ex_fsid;
|
||||||
|
new->ex_path = item->ex_path;
|
||||||
|
item->ex_path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cache_head *svc_export_alloc(void)
|
static struct cache_head *svc_export_alloc(void)
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct svc_export {
|
||||||
int ex_flags;
|
int ex_flags;
|
||||||
struct vfsmount * ex_mnt;
|
struct vfsmount * ex_mnt;
|
||||||
struct dentry * ex_dentry;
|
struct dentry * ex_dentry;
|
||||||
|
char * ex_path;
|
||||||
uid_t ex_anon_uid;
|
uid_t ex_anon_uid;
|
||||||
gid_t ex_anon_gid;
|
gid_t ex_anon_gid;
|
||||||
int ex_fsid;
|
int ex_fsid;
|
||||||
|
|
Loading…
Reference in a new issue