diff options
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index c86b7077b92f..893a6fef9853 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -307,9 +307,15 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
307 | if(atomic_read(&ses->server->inFlight) >= | 307 | if(atomic_read(&ses->server->inFlight) >= |
308 | cifs_max_pending){ | 308 | cifs_max_pending){ |
309 | spin_unlock(&GlobalMid_Lock); | 309 | spin_unlock(&GlobalMid_Lock); |
310 | #ifdef CONFIG_CIFS_STATS2 | ||
311 | atomic_inc(&ses->server->num_waiters); | ||
312 | #endif | ||
310 | wait_event(ses->server->request_q, | 313 | wait_event(ses->server->request_q, |
311 | atomic_read(&ses->server->inFlight) | 314 | atomic_read(&ses->server->inFlight) |
312 | < cifs_max_pending); | 315 | < cifs_max_pending); |
316 | #ifdef CONFIG_CIFS_STATS2 | ||
317 | atomic_dec(&ses->server->num_waiters); | ||
318 | #endif | ||
313 | spin_lock(&GlobalMid_Lock); | 319 | spin_lock(&GlobalMid_Lock); |
314 | } else { | 320 | } else { |
315 | if(ses->server->tcpStatus == CifsExiting) { | 321 | if(ses->server->tcpStatus == CifsExiting) { |
@@ -365,8 +371,14 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
365 | /* rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number); */ | 371 | /* rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number); */ |
366 | 372 | ||
367 | midQ->midState = MID_REQUEST_SUBMITTED; | 373 | midQ->midState = MID_REQUEST_SUBMITTED; |
374 | #ifdef CONFIG_CIFS_STATS2 | ||
375 | atomic_inc(&ses->server->inSend); | ||
376 | #endif | ||
368 | rc = smb_send2(ses->server->ssocket, iov, n_vec, | 377 | rc = smb_send2(ses->server->ssocket, iov, n_vec, |
369 | (struct sockaddr *) &(ses->server->addr.sockAddr)); | 378 | (struct sockaddr *) &(ses->server->addr.sockAddr)); |
379 | #ifdef CONFIG_CIFS_STATS2 | ||
380 | atomic_dec(&ses->server->inSend); | ||
381 | #endif | ||
370 | if(rc < 0) { | 382 | if(rc < 0) { |
371 | DeleteMidQEntry(midQ); | 383 | DeleteMidQEntry(midQ); |
372 | up(&ses->server->tcpSem); | 384 | up(&ses->server->tcpSem); |
@@ -546,9 +558,15 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
546 | if(atomic_read(&ses->server->inFlight) >= | 558 | if(atomic_read(&ses->server->inFlight) >= |
547 | cifs_max_pending){ | 559 | cifs_max_pending){ |
548 | spin_unlock(&GlobalMid_Lock); | 560 | spin_unlock(&GlobalMid_Lock); |
561 | #ifdef CONFIG_CIFS_STATS2 | ||
562 | atomic_inc(&ses->server->num_waiters); | ||
563 | #endif | ||
549 | wait_event(ses->server->request_q, | 564 | wait_event(ses->server->request_q, |
550 | atomic_read(&ses->server->inFlight) | 565 | atomic_read(&ses->server->inFlight) |
551 | < cifs_max_pending); | 566 | < cifs_max_pending); |
567 | #ifdef CONFIG_CIFS_STATS2 | ||
568 | atomic_dec(&ses->server->num_waiters); | ||
569 | #endif | ||
552 | spin_lock(&GlobalMid_Lock); | 570 | spin_lock(&GlobalMid_Lock); |
553 | } else { | 571 | } else { |
554 | if(ses->server->tcpStatus == CifsExiting) { | 572 | if(ses->server->tcpStatus == CifsExiting) { |
@@ -617,8 +635,14 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
617 | rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number); | 635 | rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number); |
618 | 636 | ||
619 | midQ->midState = MID_REQUEST_SUBMITTED; | 637 | midQ->midState = MID_REQUEST_SUBMITTED; |
638 | #ifdef CONFIG_CIFS_STATS2 | ||
639 | atomic_inc(&ses->server->inSend); | ||
640 | #endif | ||
620 | rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, | 641 | rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, |
621 | (struct sockaddr *) &(ses->server->addr.sockAddr)); | 642 | (struct sockaddr *) &(ses->server->addr.sockAddr)); |
643 | #ifdef CONFIG_CIFS_STATS2 | ||
644 | atomic_dec(&ses->server->inSend); | ||
645 | #endif | ||
622 | if(rc < 0) { | 646 | if(rc < 0) { |
623 | DeleteMidQEntry(midQ); | 647 | DeleteMidQEntry(midQ); |
624 | up(&ses->server->tcpSem); | 648 | up(&ses->server->tcpSem); |