Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309791
b: refs/heads/master
c: f2c7ea1
h: refs/heads/master
i:
  309789: 218f0a3
  309787: 03ae01e
  309783: a7920d8
  309775: c34005c
  309759: f82b8e1
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Apr 11, 2012
1 parent 472e3eb commit 00960bc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a09581f29434ae67f8fc6ae487e4f30a7f0d019f
refs/heads/master: f2c7ea10f901b7648eb61f1da7243588351f1dac
18 changes: 11 additions & 7 deletions trunk/fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,13 +1029,14 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp)
/* Iterator */

static void *e_start(struct seq_file *m, loff_t *pos)
__acquires(svc_export_cache.hash_lock)
__acquires(((struct cache_detail *)m->private)->hash_lock)
{
loff_t n = *pos;
unsigned hash, export;
struct cache_head *ch;

read_lock(&svc_export_cache.hash_lock);
struct cache_detail *cd = m->private;

read_lock(&cd->hash_lock);
if (!n--)
return SEQ_START_TOKEN;
hash = n >> 32;
Expand Down Expand Up @@ -1082,9 +1083,11 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos)
}

static void e_stop(struct seq_file *m, void *p)
__releases(svc_export_cache.hash_lock)
__releases(((struct cache_detail *)m->private)->hash_lock)
{
read_unlock(&svc_export_cache.hash_lock);
struct cache_detail *cd = m->private;

read_unlock(&cd->hash_lock);
}

static struct flags {
Expand Down Expand Up @@ -1195,6 +1198,7 @@ static int e_show(struct seq_file *m, void *p)
{
struct cache_head *cp = p;
struct svc_export *exp = container_of(cp, struct svc_export, h);
struct cache_detail *cd = m->private;

if (p == SEQ_START_TOKEN) {
seq_puts(m, "# Version 1.1\n");
Expand All @@ -1203,10 +1207,10 @@ static int e_show(struct seq_file *m, void *p)
}

cache_get(&exp->h);
if (cache_check(&svc_export_cache, &exp->h, NULL))
if (cache_check(cd, &exp->h, NULL))
return 0;
exp_put(exp);
return svc_export_show(m, &svc_export_cache, cp);
return svc_export_show(m, cd, cp);
}

const struct seq_operations nfs_exports_op = {
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,16 @@ static const struct file_operations transaction_ops = {

static int exports_open(struct inode *inode, struct file *file)
{
return seq_open(file, &nfs_exports_op);
int err;
struct seq_file *seq;

err = seq_open(file, &nfs_exports_op);
if (err)
return err;

seq = file->private_data;
seq->private = &svc_export_cache;
return 0;
}

static const struct file_operations exports_operations = {
Expand Down

0 comments on commit 00960bc

Please sign in to comment.