diff options
author | Volker Lendecke <vl@samba.org> | 2008-12-06 10:22:15 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-12-25 21:29:12 -0500 |
commit | 8e4f2e8a1e5cfa07c5b2731accee0e6eb4c64575 (patch) | |
tree | 1708d4173cf39a48639aaeb9ef1e6085ca16ba44 /fs | |
parent | 829049cbb1d2ddda2be17ea008b6b3c457808d91 (diff) |
Slightly streamline SendReceive[2]
Slightly streamline SendReceive[2]
Remove an else branch by naming the error condition what it is
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/transport.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index dc2d1b0bba58..01b3aa5f928b 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -583,10 +583,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
583 | wait_for_response(ses, midQ, timeout, 10 * HZ); | 583 | wait_for_response(ses, midQ, timeout, 10 * HZ); |
584 | 584 | ||
585 | spin_lock(&GlobalMid_Lock); | 585 | spin_lock(&GlobalMid_Lock); |
586 | if (midQ->resp_buf) { | 586 | |
587 | spin_unlock(&GlobalMid_Lock); | 587 | if (midQ->resp_buf == NULL) { |
588 | receive_len = midQ->resp_buf->smb_buf_length; | ||
589 | } else { | ||
590 | cERROR(1, ("No response to cmd %d mid %d", | 588 | cERROR(1, ("No response to cmd %d mid %d", |
591 | midQ->command, midQ->mid)); | 589 | midQ->command, midQ->mid)); |
592 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | 590 | if (midQ->midState == MID_REQUEST_SUBMITTED) { |
@@ -614,6 +612,9 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
614 | return rc; | 612 | return rc; |
615 | } | 613 | } |
616 | 614 | ||
615 | spin_unlock(&GlobalMid_Lock); | ||
616 | receive_len = midQ->resp_buf->smb_buf_length; | ||
617 | |||
617 | if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { | 618 | if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { |
618 | cERROR(1, ("Frame too large received. Length: %d Xid: %d", | 619 | cERROR(1, ("Frame too large received. Length: %d Xid: %d", |
619 | receive_len, xid)); | 620 | receive_len, xid)); |
@@ -773,10 +774,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
773 | wait_for_response(ses, midQ, timeout, 10 * HZ); | 774 | wait_for_response(ses, midQ, timeout, 10 * HZ); |
774 | 775 | ||
775 | spin_lock(&GlobalMid_Lock); | 776 | spin_lock(&GlobalMid_Lock); |
776 | if (midQ->resp_buf) { | 777 | if (midQ->resp_buf == NULL) { |
777 | spin_unlock(&GlobalMid_Lock); | ||
778 | receive_len = midQ->resp_buf->smb_buf_length; | ||
779 | } else { | ||
780 | cERROR(1, ("No response for cmd %d mid %d", | 778 | cERROR(1, ("No response for cmd %d mid %d", |
781 | midQ->command, midQ->mid)); | 779 | midQ->command, midQ->mid)); |
782 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | 780 | if (midQ->midState == MID_REQUEST_SUBMITTED) { |
@@ -804,6 +802,9 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
804 | return rc; | 802 | return rc; |
805 | } | 803 | } |
806 | 804 | ||
805 | spin_unlock(&GlobalMid_Lock); | ||
806 | receive_len = midQ->resp_buf->smb_buf_length; | ||
807 | |||
807 | if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { | 808 | if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { |
808 | cERROR(1, ("Frame too large received. Length: %d Xid: %d", | 809 | cERROR(1, ("Frame too large received. Length: %d Xid: %d", |
809 | receive_len, xid)); | 810 | receive_len, xid)); |