|
@@ -34,6 +34,7 @@
|
|
#include <linux/nfsd/syscall.h>
|
|
#include <linux/nfsd/syscall.h>
|
|
#include <linux/lockd/bind.h>
|
|
#include <linux/lockd/bind.h>
|
|
#include <linux/nfsacl.h>
|
|
#include <linux/nfsacl.h>
|
|
|
|
+#include <linux/seq_file.h>
|
|
|
|
|
|
#define NFSDDBG_FACILITY NFSDDBG_SVC
|
|
#define NFSDDBG_FACILITY NFSDDBG_SVC
|
|
|
|
|
|
@@ -614,7 +615,25 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
|
|
|
|
|
|
int nfsd_pool_stats_open(struct inode *inode, struct file *file)
|
|
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 -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;
|
|
}
|
|
}
|