summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-11-19 13:51:20 +0100
committerJ. Bruce Fields <bfields@redhat.com>2014-12-09 17:22:21 +0100
commit4d5db3f536ae3886ac86877742e6f8ce69a5de06 (patch)
tree611d0882898d50002069e80e282cb61171980505 /net/sunrpc
parentsunrpc: move rq_cachetype field to better optimize space (diff)
downloadlinux-4d5db3f536ae3886ac86877742e6f8ce69a5de06.tar.xz
linux-4d5db3f536ae3886ac86877742e6f8ce69a5de06.zip
sunrpc: convert sp_task_pending flag to use atomic bitops
In a later patch, we'll want to be able to handle this flag without holding the sp_lock. Change this field to an unsigned long flags field, and declare a new flag in it that can be managed with atomic bitops. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svc_xprt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 143c4c8ea2f1..37446046f4bf 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -509,7 +509,7 @@ void svc_wake_up(struct svc_serv *serv)
*/
wake_up_process(rqstp->rq_task);
} else
- pool->sp_task_pending = 1;
+ set_bit(SP_TASK_PENDING, &pool->sp_flags);
spin_unlock_bh(&pool->sp_lock);
}
}
@@ -644,10 +644,9 @@ static struct svc_xprt *svc_get_next_xprt(struct svc_rqst *rqstp, long timeout)
* long for cache updates.
*/
rqstp->rq_chandle.thread_wait = 1*HZ;
- pool->sp_task_pending = 0;
+ clear_bit(SP_TASK_PENDING, &pool->sp_flags);
} else {
- if (pool->sp_task_pending) {
- pool->sp_task_pending = 0;
+ if (test_and_clear_bit(SP_TASK_PENDING, &pool->sp_flags)) {
xprt = ERR_PTR(-EAGAIN);
goto out;
}