Skip to content

Commit db3a353

Browse files
Stanislav KinsburskyJ. Bruce Fields
authored andcommitted
nfsd: add link to owner cache detail to svc_export structure
Without info about owner cache datail it won't be able to find out, which per-net cache detail have to be. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent d4bb527 commit db3a353

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎fs/nfsd/export.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
525525
goto out1;
526526

527527
exp.ex_client = dom;
528+
exp.cd = cd;
528529

529530
/* expiry */
530531
err = -EINVAL;
@@ -672,6 +673,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
672673
new->ex_fslocs.locations = NULL;
673674
new->ex_fslocs.locations_count = 0;
674675
new->ex_fslocs.migrated = 0;
676+
new->cd = item->cd;
675677
}
676678

677679
static void export_update(struct cache_head *cnew, struct cache_head *citem)
@@ -739,8 +741,7 @@ svc_export_lookup(struct svc_export *exp)
739741
struct cache_head *ch;
740742
int hash = svc_export_hash(exp);
741743

742-
ch = sunrpc_cache_lookup(&svc_export_cache, &exp->h,
743-
hash);
744+
ch = sunrpc_cache_lookup(exp->cd, &exp->h, hash);
744745
if (ch)
745746
return container_of(ch, struct svc_export, h);
746747
else
@@ -753,9 +754,7 @@ svc_export_update(struct svc_export *new, struct svc_export *old)
753754
struct cache_head *ch;
754755
int hash = svc_export_hash(old);
755756

756-
ch = sunrpc_cache_update(&svc_export_cache, &new->h,
757-
&old->h,
758-
hash);
757+
ch = sunrpc_cache_update(old->cd, &new->h, &old->h, hash);
759758
if (ch)
760759
return container_of(ch, struct svc_export, h);
761760
else
@@ -797,6 +796,7 @@ static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
797796

798797
key.ex_client = clp;
799798
key.ex_path = *path;
799+
key.cd = &svc_export_cache;
800800

801801
exp = svc_export_lookup(&key);
802802
if (exp == NULL)

‎include/linux/nfsd/export.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ struct svc_export {
103103
struct nfsd4_fs_locations ex_fslocs;
104104
int ex_nflavors;
105105
struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST];
106+
struct cache_detail *cd;
106107
};
107108

108109
/* an "export key" (expkey) maps a filehandlefragement to an

0 commit comments

Comments
 (0)