diff options
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index d68cd056b281..675d395c4ab6 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/nfsd/syscall.h> | 34 | #include <linux/nfsd/syscall.h> |
35 | #include <linux/lockd/bind.h> | 35 | #include <linux/lockd/bind.h> |
36 | #include <linux/nfsacl.h> | 36 | #include <linux/nfsacl.h> |
37 | #include <linux/seq_file.h> | ||
37 | 38 | ||
38 | #define NFSDDBG_FACILITY NFSDDBG_SVC | 39 | #define NFSDDBG_FACILITY NFSDDBG_SVC |
39 | 40 | ||
@@ -614,7 +615,25 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) | |||
614 | 615 | ||
615 | int nfsd_pool_stats_open(struct inode *inode, struct file *file) | 616 | int nfsd_pool_stats_open(struct inode *inode, struct file *file) |
616 | { | 617 | { |
617 | if (nfsd_serv == NULL) | 618 | int ret; |
619 | mutex_lock(&nfsd_mutex); | ||
620 | if (nfsd_serv == NULL) { | ||
621 | mutex_unlock(&nfsd_mutex); | ||
618 | return -ENODEV; | 622 | return -ENODEV; |
619 | return svc_pool_stats_open(nfsd_serv, file); | 623 | } |
624 | /* bump up the psudo refcount while traversing */ | ||
625 | svc_get(nfsd_serv); | ||
626 | ret = svc_pool_stats_open(nfsd_serv, file); | ||
627 | mutex_unlock(&nfsd_mutex); | ||
628 | return ret; | ||
629 | } | ||
630 | |||
631 | int nfsd_pool_stats_release(struct inode *inode, struct file *file) | ||
632 | { | ||
633 | int ret = seq_release(inode, file); | ||
634 | mutex_lock(&nfsd_mutex); | ||
635 | /* this function really, really should have been called svc_put() */ | ||
636 | svc_destroy(nfsd_serv); | ||
637 | mutex_unlock(&nfsd_mutex); | ||
638 | return ret; | ||
620 | } | 639 | } |