提交 5da07b02 编写于 作者: S Steve French

[CIFS] Make midState usage more consistent

Although harmless, we were sometimes treating midState like it contained
flags but they are exclusive states, and this makes that more clear.
Signed-off-by: NJeremy Allison <jra@samba.org>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
(cherry picked from 586c057c3a68dd6ae0f3ba94fbf76798b1558074 commit)
上级 14a441a2
...@@ -448,13 +448,13 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -448,13 +448,13 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
for (;;) { for (;;) {
curr_timeout = timeout + jiffies; curr_timeout = timeout + jiffies;
wait_event(ses->server->response_q, wait_event(ses->server->response_q,
(!(midQ->midState & MID_REQUEST_SUBMITTED)) || (!(midQ->midState == MID_REQUEST_SUBMITTED)) ||
time_after(jiffies, curr_timeout) || time_after(jiffies, curr_timeout) ||
((ses->server->tcpStatus != CifsGood) && ((ses->server->tcpStatus != CifsGood) &&
(ses->server->tcpStatus != CifsNew))); (ses->server->tcpStatus != CifsNew)));
if (time_after(jiffies, curr_timeout) && if (time_after(jiffies, curr_timeout) &&
(midQ->midState & MID_REQUEST_SUBMITTED) && (midQ->midState == MID_REQUEST_SUBMITTED) &&
((ses->server->tcpStatus == CifsGood) || ((ses->server->tcpStatus == CifsGood) ||
(ses->server->tcpStatus == CifsNew))) { (ses->server->tcpStatus == CifsNew))) {
...@@ -485,7 +485,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -485,7 +485,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
} }
} else { } else {
wait_event(ses->server->response_q, wait_event(ses->server->response_q,
(!(midQ->midState & MID_REQUEST_SUBMITTED)) || (!(midQ->midState == MID_REQUEST_SUBMITTED)) ||
((ses->server->tcpStatus != CifsGood) && ((ses->server->tcpStatus != CifsGood) &&
(ses->server->tcpStatus != CifsNew))); (ses->server->tcpStatus != CifsNew)));
} }
...@@ -749,13 +749,13 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -749,13 +749,13 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
for (;;) { for (;;) {
curr_timeout = timeout + jiffies; curr_timeout = timeout + jiffies;
wait_event(ses->server->response_q, wait_event(ses->server->response_q,
(!(midQ->midState & MID_REQUEST_SUBMITTED)) || (!(midQ->midState == MID_REQUEST_SUBMITTED)) ||
time_after(jiffies, curr_timeout) || time_after(jiffies, curr_timeout) ||
((ses->server->tcpStatus != CifsGood) && ((ses->server->tcpStatus != CifsGood) &&
(ses->server->tcpStatus != CifsNew))); (ses->server->tcpStatus != CifsNew)));
if (time_after(jiffies, curr_timeout) && if (time_after(jiffies, curr_timeout) &&
(midQ->midState & MID_REQUEST_SUBMITTED) && (midQ->midState == MID_REQUEST_SUBMITTED) &&
((ses->server->tcpStatus == CifsGood) || ((ses->server->tcpStatus == CifsGood) ||
(ses->server->tcpStatus == CifsNew))) { (ses->server->tcpStatus == CifsNew))) {
...@@ -780,7 +780,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -780,7 +780,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
} }
} else { } else {
wait_event(ses->server->response_q, wait_event(ses->server->response_q,
(!(midQ->midState & MID_REQUEST_SUBMITTED)) || (!(midQ->midState == MID_REQUEST_SUBMITTED)) ||
((ses->server->tcpStatus != CifsGood) && ((ses->server->tcpStatus != CifsGood) &&
(ses->server->tcpStatus != CifsNew))); (ses->server->tcpStatus != CifsNew)));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册