diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-02-17 17:09:12 +0300 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-03-21 11:27:35 -0500 |
commit | fc40f9cf828908e91d9af820e9300a9d42fbbd72 (patch) | |
tree | 1d0aa12f099ea9c759321d5e75967e152fcf4b11 /fs/cifs/connect.c | |
parent | 1daaae8fa4afe3df78ca34e724ed7e8187e4eb32 (diff) | |
download | blackbird-op-linux-fc40f9cf828908e91d9af820e9300a9d42fbbd72.tar.gz blackbird-op-linux-fc40f9cf828908e91d9af820e9300a9d42fbbd72.zip |
CIFS: Simplify inFlight logic
by making it as unsigned integer and surround access with req_lock
from server structure.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0ac595c8c262..ed91abcce8a9 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -643,14 +643,14 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) wake_up_all(&server->response_q); /* Check if we have blocked requests that need to free. */ - spin_lock(&GlobalMid_Lock); - if (atomic_read(&server->inFlight) >= server->maxReq) - atomic_set(&server->inFlight, server->maxReq - 1); + spin_lock(&server->req_lock); + if (server->in_flight >= server->maxReq) + server->in_flight = server->maxReq - 1; /* * We do not want to set the max_pending too low or we could end up * with the counter going negative. */ - spin_unlock(&GlobalMid_Lock); + spin_unlock(&server->req_lock); /* * Although there should not be any requests blocked on this queue it * can not hurt to be paranoid and try to wake up requests that may @@ -1905,7 +1905,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info) tcp_ses->noblocksnd = volume_info->noblocksnd; tcp_ses->noautotune = volume_info->noautotune; tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay; - atomic_set(&tcp_ses->inFlight, 0); + tcp_ses->in_flight = 0; tcp_ses->maxReq = 1; /* enough to send negotiate request */ init_waitqueue_head(&tcp_ses->response_q); init_waitqueue_head(&tcp_ses->request_q); |