Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164615
b: refs/heads/master
c: ed2d8ae
h: refs/heads/master
i:
  164613: 713f6b6
  164611: 59a2524
  164607: 3b7227b
v: v3
  • Loading branch information
Ryusei Yamaguchi authored and J. Bruce Fields committed Aug 25, 2009
1 parent 8900174 commit 0856367
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 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: 55bb55dca0cecac2fb7b8c743db41361c011c8a8
refs/heads/master: ed2d8aed52212610d4cb79be3cbf535b04be38dc
3 changes: 2 additions & 1 deletion trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,13 @@ static const struct file_operations exports_operations = {
};

extern int nfsd_pool_stats_open(struct inode *inode, struct file *file);
extern int nfsd_pool_stats_release(struct inode *inode, struct file *file);

static struct file_operations pool_stats_operations = {
.open = nfsd_pool_stats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.release = nfsd_pool_stats_release,
.owner = THIS_MODULE,
};

Expand Down
23 changes: 21 additions & 2 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/nfsd/syscall.h>
#include <linux/lockd/bind.h>
#include <linux/nfsacl.h>
#include <linux/seq_file.h>

#define NFSDDBG_FACILITY NFSDDBG_SVC

Expand Down Expand Up @@ -614,7 +615,25 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)

int nfsd_pool_stats_open(struct inode *inode, struct file *file)
{
if (nfsd_serv == NULL)
int ret;
mutex_lock(&nfsd_mutex);
if (nfsd_serv == NULL) {
mutex_unlock(&nfsd_mutex);
return -ENODEV;
return svc_pool_stats_open(nfsd_serv, file);
}
/* bump up the psudo refcount while traversing */
svc_get(nfsd_serv);
ret = svc_pool_stats_open(nfsd_serv, file);
mutex_unlock(&nfsd_mutex);
return ret;
}

int nfsd_pool_stats_release(struct inode *inode, struct file *file)
{
int ret = seq_release(inode, file);
mutex_lock(&nfsd_mutex);
/* this function really, really should have been called svc_put() */
svc_destroy(nfsd_serv);
mutex_unlock(&nfsd_mutex);
return ret;
}
11 changes: 0 additions & 11 deletions trunk/net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,6 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos)

dprintk("svc_pool_stats_start, *pidx=%u\n", pidx);

lock_kernel();
/* bump up the pseudo refcount while traversing */
svc_get(serv);
unlock_kernel();

if (!pidx)
return SEQ_START_TOKEN;
return (pidx > serv->sv_nrpools ? NULL : &serv->sv_pools[pidx-1]);
Expand Down Expand Up @@ -1198,12 +1193,6 @@ static void *svc_pool_stats_next(struct seq_file *m, void *p, loff_t *pos)

static void svc_pool_stats_stop(struct seq_file *m, void *p)
{
struct svc_serv *serv = m->private;

lock_kernel();
/* this function really, really should have been called svc_put() */
svc_destroy(serv);
unlock_kernel();
}

static int svc_pool_stats_show(struct seq_file *m, void *p)
Expand Down

0 comments on commit 0856367

Please sign in to comment.