diff options
author | J.Bruce Fields <bfields@fieldses.org> | 2006-10-04 05:16:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:22 -0400 |
commit | b009a873de05c6e0d7613df3584b6dcb2e4280ee (patch) | |
tree | a79bc4a82ca4bf8f3564fd024ffd0eedcdddab34 /fs/nfsd | |
parent | 21c0d8fdd95024ffa708a938099148b8f1078d46 (diff) |
[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>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/export.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 597b3cbf8b0b..d3178de589e4 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -325,6 +325,7 @@ static void svc_export_put(struct kref *ref) | |||
325 | dput(exp->ex_dentry); | 325 | dput(exp->ex_dentry); |
326 | mntput(exp->ex_mnt); | 326 | mntput(exp->ex_mnt); |
327 | auth_domain_put(exp->ex_client); | 327 | auth_domain_put(exp->ex_client); |
328 | kfree(exp->ex_path); | ||
328 | kfree(exp); | 329 | kfree(exp); |
329 | } | 330 | } |
330 | 331 | ||
@@ -398,6 +399,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
398 | int an_int; | 399 | int an_int; |
399 | 400 | ||
400 | nd.dentry = NULL; | 401 | nd.dentry = NULL; |
402 | exp.ex_path = NULL; | ||
401 | 403 | ||
402 | if (mesg[mlen-1] != '\n') | 404 | if (mesg[mlen-1] != '\n') |
403 | return -EINVAL; | 405 | return -EINVAL; |
@@ -428,6 +430,10 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
428 | exp.ex_client = dom; | 430 | exp.ex_client = dom; |
429 | exp.ex_mnt = nd.mnt; | 431 | exp.ex_mnt = nd.mnt; |
430 | exp.ex_dentry = nd.dentry; | 432 | exp.ex_dentry = nd.dentry; |
433 | exp.ex_path = kstrdup(buf, GFP_KERNEL); | ||
434 | err = -ENOMEM; | ||
435 | if (!exp.ex_path) | ||
436 | goto out; | ||
431 | 437 | ||
432 | /* expiry */ | 438 | /* expiry */ |
433 | err = -EINVAL; | 439 | err = -EINVAL; |
@@ -473,6 +479,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
473 | else | 479 | else |
474 | exp_put(expp); | 480 | exp_put(expp); |
475 | out: | 481 | out: |
482 | kfree(exp.ex_path); | ||
476 | if (nd.dentry) | 483 | if (nd.dentry) |
477 | path_release(&nd); | 484 | path_release(&nd); |
478 | out_no_path: | 485 | out_no_path: |
@@ -524,6 +531,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) | |||
524 | new->ex_client = item->ex_client; | 531 | new->ex_client = item->ex_client; |
525 | new->ex_dentry = dget(item->ex_dentry); | 532 | new->ex_dentry = dget(item->ex_dentry); |
526 | new->ex_mnt = mntget(item->ex_mnt); | 533 | new->ex_mnt = mntget(item->ex_mnt); |
534 | new->ex_path = NULL; | ||
527 | } | 535 | } |
528 | 536 | ||
529 | static void export_update(struct cache_head *cnew, struct cache_head *citem) | 537 | 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) | |||
535 | new->ex_anon_uid = item->ex_anon_uid; | 543 | new->ex_anon_uid = item->ex_anon_uid; |
536 | new->ex_anon_gid = item->ex_anon_gid; | 544 | new->ex_anon_gid = item->ex_anon_gid; |
537 | new->ex_fsid = item->ex_fsid; | 545 | new->ex_fsid = item->ex_fsid; |
546 | new->ex_path = item->ex_path; | ||
547 | item->ex_path = NULL; | ||
538 | } | 548 | } |
539 | 549 | ||
540 | static struct cache_head *svc_export_alloc(void) | 550 | static struct cache_head *svc_export_alloc(void) |