diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-02-17 09:09:12 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-03-21 12:27:35 -0400 |
commit | fc40f9cf828908e91d9af820e9300a9d42fbbd72 (patch) | |
tree | 1d0aa12f099ea9c759321d5e75967e152fcf4b11 /fs/cifs/connect.c | |
parent | 1daaae8fa4afe3df78ca34e724ed7e8187e4eb32 (diff) |
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) | |||
643 | wake_up_all(&server->response_q); | 643 | wake_up_all(&server->response_q); |
644 | 644 | ||
645 | /* Check if we have blocked requests that need to free. */ | 645 | /* Check if we have blocked requests that need to free. */ |
646 | spin_lock(&GlobalMid_Lock); | 646 | spin_lock(&server->req_lock); |
647 | if (atomic_read(&server->inFlight) >= server->maxReq) | 647 | if (server->in_flight >= server->maxReq) |
648 | atomic_set(&server->inFlight, server->maxReq - 1); | 648 | server->in_flight = server->maxReq - 1; |
649 | /* | 649 | /* |
650 | * We do not want to set the max_pending too low or we could end up | 650 | * We do not want to set the max_pending too low or we could end up |
651 | * with the counter going negative. | 651 | * with the counter going negative. |
652 | */ | 652 | */ |
653 | spin_unlock(&GlobalMid_Lock); | 653 | spin_unlock(&server->req_lock); |
654 | /* | 654 | /* |
655 | * Although there should not be any requests blocked on this queue it | 655 | * Although there should not be any requests blocked on this queue it |
656 | * can not hurt to be paranoid and try to wake up requests that may | 656 | * 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) | |||
1905 | tcp_ses->noblocksnd = volume_info->noblocksnd; | 1905 | tcp_ses->noblocksnd = volume_info->noblocksnd; |
1906 | tcp_ses->noautotune = volume_info->noautotune; | 1906 | tcp_ses->noautotune = volume_info->noautotune; |
1907 | tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay; | 1907 | tcp_ses->tcp_nodelay = volume_info->sockopt_tcp_nodelay; |
1908 | atomic_set(&tcp_ses->inFlight, 0); | 1908 | tcp_ses->in_flight = 0; |
1909 | tcp_ses->maxReq = 1; /* enough to send negotiate request */ | 1909 | tcp_ses->maxReq = 1; /* enough to send negotiate request */ |
1910 | init_waitqueue_head(&tcp_ses->response_q); | 1910 | init_waitqueue_head(&tcp_ses->response_q); |
1911 | init_waitqueue_head(&tcp_ses->request_q); | 1911 | init_waitqueue_head(&tcp_ses->request_q); |