Skip to content

Commit e19b2bc

Browse files
Ronnie Sahlbergsmfrench
authored andcommitted
cifs: add resp_buf_size to the mid_q_entry structure
and get rid of some more calls to get_rfc1002_length() Signed-off-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Pavel Shilovsky <[email protected]>
1 parent 0d4b46b commit e19b2bc

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

fs/cifs/cifsglob.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@ struct mid_q_entry {
13761376
mid_handle_t *handle; /* call handle mid callback */
13771377
void *callback_data; /* general purpose pointer for callback */
13781378
void *resp_buf; /* pointer to received SMB header */
1379+
unsigned int resp_buf_size;
13791380
int mid_state; /* wish this were enum but can not pass to wait_event */
13801381
unsigned int mid_flags;
13811382
__le16 command; /* smb command code */

fs/cifs/connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ cifs_demultiplex_thread(void *p)
928928

929929
server->lstrp = jiffies;
930930
if (mid_entry != NULL) {
931+
mid_entry->resp_buf_size = server->pdu_size;
931932
if ((mid_entry->mid_flags & MID_WAIT_CANCELLED) &&
932933
mid_entry->mid_state == MID_RESPONSE_RECEIVED &&
933934
server->ops->handle_cancelled_mid)

fs/cifs/smb2transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ int
604604
smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
605605
bool log_error)
606606
{
607-
unsigned int len = get_rfc1002_length(mid->resp_buf);
607+
unsigned int len = mid->resp_buf_size;
608608
struct kvec iov[2];
609609
struct smb_rqst rqst = { .rq_iov = iov,
610610
.rq_nvec = 2 };

fs/cifs/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
790790

791791
buf = (char *)midQ->resp_buf;
792792
resp_iov->iov_base = buf;
793-
resp_iov->iov_len = get_rfc1002_length(buf) +
793+
resp_iov->iov_len = midQ->resp_buf_size +
794794
ses->server->vals->header_preamble_size;
795795
if (midQ->large_buf)
796796
*resp_buf_type = CIFS_LARGE_BUFFER;

0 commit comments

Comments
 (0)