diff options
-rw-r--r-- | include/linux/sunrpc/svc.h | 6 | ||||
-rw-r--r-- | net/sunrpc/svc_xprt.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 7f80a99c59e4..513957eba0a5 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -26,10 +26,10 @@ typedef int (*svc_thread_fn)(void *); | |||
26 | 26 | ||
27 | /* statistics for svc_pool structures */ | 27 | /* statistics for svc_pool structures */ |
28 | struct svc_pool_stats { | 28 | struct svc_pool_stats { |
29 | unsigned long packets; | 29 | atomic_long_t packets; |
30 | unsigned long sockets_queued; | 30 | unsigned long sockets_queued; |
31 | unsigned long threads_woken; | 31 | atomic_long_t threads_woken; |
32 | unsigned long threads_timedout; | 32 | atomic_long_t threads_timedout; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | /* | 35 | /* |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index b2676e597fc4..579ff2249562 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -362,7 +362,7 @@ static void svc_xprt_do_enqueue(struct svc_xprt *xprt) | |||
362 | pool = svc_pool_for_cpu(xprt->xpt_server, cpu); | 362 | pool = svc_pool_for_cpu(xprt->xpt_server, cpu); |
363 | spin_lock_bh(&pool->sp_lock); | 363 | spin_lock_bh(&pool->sp_lock); |
364 | 364 | ||
365 | pool->sp_stats.packets++; | 365 | atomic_long_inc(&pool->sp_stats.packets); |
366 | 366 | ||
367 | if (!list_empty(&pool->sp_threads)) { | 367 | if (!list_empty(&pool->sp_threads)) { |
368 | rqstp = list_entry(pool->sp_threads.next, | 368 | rqstp = list_entry(pool->sp_threads.next, |
@@ -383,7 +383,7 @@ static void svc_xprt_do_enqueue(struct svc_xprt *xprt) | |||
383 | svc_xprt_get(xprt); | 383 | svc_xprt_get(xprt); |
384 | wake_up_process(rqstp->rq_task); | 384 | wake_up_process(rqstp->rq_task); |
385 | rqstp->rq_xprt = xprt; | 385 | rqstp->rq_xprt = xprt; |
386 | pool->sp_stats.threads_woken++; | 386 | atomic_long_inc(&pool->sp_stats.threads_woken); |
387 | } else { | 387 | } else { |
388 | dprintk("svc: transport %p put into queue\n", xprt); | 388 | dprintk("svc: transport %p put into queue\n", xprt); |
389 | list_add_tail(&xprt->xpt_ready, &pool->sp_sockets); | 389 | list_add_tail(&xprt->xpt_ready, &pool->sp_sockets); |
@@ -669,7 +669,7 @@ static struct svc_xprt *svc_get_next_xprt(struct svc_rqst *rqstp, long timeout) | |||
669 | 669 | ||
670 | spin_lock_bh(&pool->sp_lock); | 670 | spin_lock_bh(&pool->sp_lock); |
671 | if (!time_left) | 671 | if (!time_left) |
672 | pool->sp_stats.threads_timedout++; | 672 | atomic_long_inc(&pool->sp_stats.threads_timedout); |
673 | 673 | ||
674 | xprt = rqstp->rq_xprt; | 674 | xprt = rqstp->rq_xprt; |
675 | if (!xprt) { | 675 | if (!xprt) { |
@@ -1306,10 +1306,10 @@ static int svc_pool_stats_show(struct seq_file *m, void *p) | |||
1306 | 1306 | ||
1307 | seq_printf(m, "%u %lu %lu %lu %lu\n", | 1307 | seq_printf(m, "%u %lu %lu %lu %lu\n", |
1308 | pool->sp_id, | 1308 | pool->sp_id, |
1309 | pool->sp_stats.packets, | 1309 | (unsigned long)atomic_long_read(&pool->sp_stats.packets), |
1310 | pool->sp_stats.sockets_queued, | 1310 | pool->sp_stats.sockets_queued, |
1311 | pool->sp_stats.threads_woken, | 1311 | (unsigned long)atomic_long_read(&pool->sp_stats.threads_woken), |
1312 | pool->sp_stats.threads_timedout); | 1312 | (unsigned long)atomic_long_read(&pool->sp_stats.threads_timedout)); |
1313 | 1313 | ||
1314 | return 0; | 1314 | return 0; |
1315 | } | 1315 | } |