aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/transport.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-01-11 07:24:01 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-19 12:52:30 -0500
commitc5797a945cac4c470f0113fc839c521aab0d799d (patch)
treee54271a77265dce9ac6a10e5c6f15d9fe7886e4c /fs/cifs/transport.c
parent9d78315b03fc91228306db42edc533efa69cb518 (diff)
cifs: make wait_for_free_request take a TCP_Server_Info pointer
The cifsSesInfo pointer is only used to get at the server. Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de> Reviewed-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r--fs/cifs/transport.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 59ca81b16919..9a14f77e0ab2 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -244,31 +244,31 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
244 return smb_sendv(server, &iov, 1); 244 return smb_sendv(server, &iov, 1);
245} 245}
246 246
247static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op) 247static int wait_for_free_request(struct TCP_Server_Info *server,
248 const int long_op)
248{ 249{
249 if (long_op == CIFS_ASYNC_OP) { 250 if (long_op == CIFS_ASYNC_OP) {
250 /* oplock breaks must not be held up */ 251 /* oplock breaks must not be held up */
251 atomic_inc(&ses->server->inFlight); 252 atomic_inc(&server->inFlight);
252 return 0; 253 return 0;
253 } 254 }
254 255
255 spin_lock(&GlobalMid_Lock); 256 spin_lock(&GlobalMid_Lock);
256 while (1) { 257 while (1) {
257 if (atomic_read(&ses->server->inFlight) >= 258 if (atomic_read(&server->inFlight) >= cifs_max_pending) {
258 cifs_max_pending){
259 spin_unlock(&GlobalMid_Lock); 259 spin_unlock(&GlobalMid_Lock);
260#ifdef CONFIG_CIFS_STATS2 260#ifdef CONFIG_CIFS_STATS2
261 atomic_inc(&ses->server->num_waiters); 261 atomic_inc(&server->num_waiters);
262#endif 262#endif
263 wait_event(ses->server->request_q, 263 wait_event(server->request_q,
264 atomic_read(&ses->server->inFlight) 264 atomic_read(&server->inFlight)
265 < cifs_max_pending); 265 < cifs_max_pending);
266#ifdef CONFIG_CIFS_STATS2 266#ifdef CONFIG_CIFS_STATS2
267 atomic_dec(&ses->server->num_waiters); 267 atomic_dec(&server->num_waiters);
268#endif 268#endif
269 spin_lock(&GlobalMid_Lock); 269 spin_lock(&GlobalMid_Lock);
270 } else { 270 } else {
271 if (ses->server->tcpStatus == CifsExiting) { 271 if (server->tcpStatus == CifsExiting) {
272 spin_unlock(&GlobalMid_Lock); 272 spin_unlock(&GlobalMid_Lock);
273 return -ENOENT; 273 return -ENOENT;
274 } 274 }
@@ -278,7 +278,7 @@ static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
278 278
279 /* update # of requests on the wire to server */ 279 /* update # of requests on the wire to server */
280 if (long_op != CIFS_BLOCKING_OP) 280 if (long_op != CIFS_BLOCKING_OP)
281 atomic_inc(&ses->server->inFlight); 281 atomic_inc(&server->inFlight);
282 spin_unlock(&GlobalMid_Lock); 282 spin_unlock(&GlobalMid_Lock);
283 break; 283 break;
284 } 284 }
@@ -413,7 +413,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
413 to the same server. We may make this configurable later or 413 to the same server. We may make this configurable later or
414 use ses->maxReq */ 414 use ses->maxReq */
415 415
416 rc = wait_for_free_request(ses, long_op); 416 rc = wait_for_free_request(ses->server, long_op);
417 if (rc) { 417 if (rc) {
418 cifs_small_buf_release(in_buf); 418 cifs_small_buf_release(in_buf);
419 return rc; 419 return rc;
@@ -610,7 +610,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
610 return -EIO; 610 return -EIO;
611 } 611 }
612 612
613 rc = wait_for_free_request(ses, long_op); 613 rc = wait_for_free_request(ses->server, long_op);
614 if (rc) 614 if (rc)
615 return rc; 615 return rc;
616 616
@@ -845,7 +845,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
845 return -EIO; 845 return -EIO;
846 } 846 }
847 847
848 rc = wait_for_free_request(ses, CIFS_BLOCKING_OP); 848 rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP);
849 if (rc) 849 if (rc)
850 return rc; 850 return rc;
851 851