Commit 0bcf0c3c authored by Steve French's avatar Steve French

Merge bk://cifs.bkbits.net/linux-2.5cifs

into stevef95.austin.ibm.com:/home/stevef/linux-2.5cifs
parents adf791bd ae68d0de
...@@ -200,23 +200,30 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -200,23 +200,30 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
} }
/* Ensure that we do not send more than 50 overlapping requests /* Ensure that we do not send more than 50 overlapping requests
to the same server. We may make this configurable later or to the same server. We may make this configurable later or
use ses->maxReq */ use ses->maxReq */
/* can not count locking commands against the total since spin_lock(&GlobalMid_Lock);
they are allowed to block on server */ while(1) {
if(long_op < 3) { if(atomic_read(&ses->server->inFlight) >= CIFS_MAX_REQ) {
/* update # of requests on the wire to this server */ spin_unlock(&GlobalMid_Lock);
atomic_inc(&ses->server->inFlight); wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) < CIFS_MAX_REQ);
} spin_lock(&GlobalMid_Lock);
} else {
if(atomic_read(&ses->server->inFlight) > CIFS_MAX_REQ) { /* can not count locking commands against the total since
wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) <= CIFS_MAX_REQ); they are allowed to block on server */
if(long_op < 3) {
/* update # of requests on the wire to this server */
atomic_inc(&ses->server->inFlight);
}
spin_unlock(&GlobalMid_Lock);
break;
}
} }
/* make sure that we sign in the same order that we send on this socket /* make sure that we sign in the same order that we send on this socket
and avoid races inside tcp sendmsg code that could cause corruption and avoid races inside tcp sendmsg code that could cause corruption
of smb data */ of smb data */
down(&ses->server->tcpSem); down(&ses->server->tcpSem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment