aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRyusei Yamaguchi <mandel59@gmail.com>2009-08-15 11:54:41 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-08-25 12:39:37 -0400
commited2d8aed52212610d4cb79be3cbf535b04be38dc (patch)
tree6baac65cfa094ac79db8a473ad7bd4b1dbbc5c2a /net
parent55bb55dca0cecac2fb7b8c743db41361c011c8a8 (diff)
knfsd: Replace lock_kernel with a mutex in nfsd pool stats.
lock_kernel() in knfsd was replaced with a mutex. The later commit 03cf6c9f49a8fea953d38648d016e3f46e814991 ("knfsd: add file to export stats about nfsd pools") did not follow that change. This patch fixes the issue. Also move the get and put of nfsd_serv to the open and close methods (instead of start and stop methods) to allow atomic check and increment of reference count in the open method (where we can still return an error). Signed-off-by: Ryusei Yamaguchi <mandel59@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Cc: Greg Banks <gnb@fmeh.org> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc_xprt.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 27d44332f017..dcd2d1ee2e3c 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1166,11 +1166,6 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos)
1166 1166
1167 dprintk("svc_pool_stats_start, *pidx=%u\n", pidx); 1167 dprintk("svc_pool_stats_start, *pidx=%u\n", pidx);
1168 1168
1169 lock_kernel();
1170 /* bump up the pseudo refcount while traversing */
1171 svc_get(serv);
1172 unlock_kernel();
1173
1174 if (!pidx) 1169 if (!pidx)
1175 return SEQ_START_TOKEN; 1170 return SEQ_START_TOKEN;
1176 return (pidx > serv->sv_nrpools ? NULL : &serv->sv_pools[pidx-1]); 1171 return (pidx > serv->sv_nrpools ? NULL : &serv->sv_pools[pidx-1]);
@@ -1198,12 +1193,6 @@ static void *svc_pool_stats_next(struct seq_file *m, void *p, loff_t *pos)
1198 1193
1199static void svc_pool_stats_stop(struct seq_file *m, void *p) 1194static void svc_pool_stats_stop(struct seq_file *m, void *p)
1200{ 1195{
1201 struct svc_serv *serv = m->private;
1202
1203 lock_kernel();
1204 /* this function really, really should have been called svc_put() */
1205 svc_destroy(serv);
1206 unlock_kernel();
1207} 1196}
1208 1197
1209static int svc_pool_stats_show(struct seq_file *m, void *p) 1198static int svc_pool_stats_show(struct seq_file *m, void *p)