aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/export.c18
-rw-r--r--fs/nfsd/nfsctl.c11
2 files changed, 21 insertions, 8 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c20a405b586..14953202377 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 = {
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 2c53be6d357..ae19293e68d 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -127,7 +127,16 @@ static const struct file_operations transaction_ops = {
127 127
128static int exports_open(struct inode *inode, struct file *file) 128static int exports_open(struct inode *inode, struct file *file)
129{ 129{
130 return seq_open(file, &nfs_exports_op); 130 int err;
131 struct seq_file *seq;
132
133 err = seq_open(file, &nfs_exports_op);
134 if (err)
135 return err;
136
137 seq = file->private_data;
138 seq->private = &svc_export_cache;
139 return 0;
131} 140}
132 141
133static const struct file_operations exports_operations = { 142static const struct file_operations exports_operations = {