aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/export.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-03-28 11:09:29 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-04-11 17:55:03 -0400
commitf2c7ea10f901b7648eb61f1da7243588351f1dac (patch)
tree26dd9756b573c3eb2a46f51b3e4d9fbfd2f19769 /fs/nfsd/export.c
parenta09581f29434ae67f8fc6ae487e4f30a7f0d019f (diff)
nfsd: pass svc_export_cache pointer as private data to "exports" seq file ops
Global svc_export_cache cache is going to be replaced with per-net instance. So prepare the ground for it. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r--fs/nfsd/export.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c20a405b5862..149532023778 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1029,13 +1029,14 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp)
1029/* Iterator */ 1029/* Iterator */
1030 1030
1031static void *e_start(struct seq_file *m, loff_t *pos) 1031static void *e_start(struct seq_file *m, loff_t *pos)
1032 __acquires(svc_export_cache.hash_lock) 1032 __acquires(((struct cache_detail *)m->private)->hash_lock)
1033{ 1033{
1034 loff_t n = *pos; 1034 loff_t n = *pos;
1035 unsigned hash, export; 1035 unsigned hash, export;
1036 struct cache_head *ch; 1036 struct cache_head *ch;
1037 1037 struct cache_detail *cd = m->private;
1038 read_lock(&svc_export_cache.hash_lock); 1038
1039 read_lock(&cd->hash_lock);
1039 if (!n--) 1040 if (!n--)
1040 return SEQ_START_TOKEN; 1041 return SEQ_START_TOKEN;
1041 hash = n >> 32; 1042 hash = n >> 32;
@@ -1082,9 +1083,11 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos)
1082} 1083}
1083 1084
1084static void e_stop(struct seq_file *m, void *p) 1085static void e_stop(struct seq_file *m, void *p)
1085 __releases(svc_export_cache.hash_lock) 1086 __releases(((struct cache_detail *)m->private)->hash_lock)
1086{ 1087{
1087 read_unlock(&svc_export_cache.hash_lock); 1088 struct cache_detail *cd = m->private;
1089
1090 read_unlock(&cd->hash_lock);
1088} 1091}
1089 1092
1090static struct flags { 1093static struct flags {
@@ -1195,6 +1198,7 @@ static int e_show(struct seq_file *m, void *p)
1195{ 1198{
1196 struct cache_head *cp = p; 1199 struct cache_head *cp = p;
1197 struct svc_export *exp = container_of(cp, struct svc_export, h); 1200 struct svc_export *exp = container_of(cp, struct svc_export, h);
1201 struct cache_detail *cd = m->private;
1198 1202
1199 if (p == SEQ_START_TOKEN) { 1203 if (p == SEQ_START_TOKEN) {
1200 seq_puts(m, "# Version 1.1\n"); 1204 seq_puts(m, "# Version 1.1\n");
@@ -1203,10 +1207,10 @@ static int e_show(struct seq_file *m, void *p)
1203 } 1207 }
1204 1208
1205 cache_get(&exp->h); 1209 cache_get(&exp->h);
1206 if (cache_check(&svc_export_cache, &exp->h, NULL)) 1210 if (cache_check(cd, &exp->h, NULL))
1207 return 0; 1211 return 0;
1208 exp_put(exp); 1212 exp_put(exp);
1209 return svc_export_show(m, &svc_export_cache, cp); 1213 return svc_export_show(m, cd, cp);
1210} 1214}
1211 1215
1212const struct seq_operations nfs_exports_op = { 1216const struct seq_operations nfs_exports_op = {