diff options
author | Steve French <sfrench@us.ibm.com> | 2005-12-02 16:32:45 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-12-02 16:32:45 -0500 |
commit | 84afc29b185334f489975a003b128e1b15e24a54 (patch) | |
tree | ab9544be46e3c52fcf799bb9bbf14c0db7b94b37 /fs/cifs/transport.c | |
parent | bf8206791750854bc6668266b694e8fe2cacb924 (diff) |
[CIFS] Readpages and readir performance improvements - eliminate extra
memcpy. Part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index f8871196098c..0abfbf4e4a49 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -206,7 +206,6 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, | |||
206 | return rc; | 206 | return rc; |
207 | } | 207 | } |
208 | 208 | ||
209 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
210 | static int | 209 | static int |
211 | smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec, | 210 | smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec, |
212 | struct sockaddr *sin) | 211 | struct sockaddr *sin) |
@@ -392,8 +391,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
392 | return -ENOMEM; | 391 | return -ENOMEM; |
393 | } | 392 | } |
394 | 393 | ||
395 | /* BB FIXME */ | 394 | rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number); |
396 | /* rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number); */ | ||
397 | 395 | ||
398 | midQ->midState = MID_REQUEST_SUBMITTED; | 396 | midQ->midState = MID_REQUEST_SUBMITTED; |
399 | #ifdef CONFIG_CIFS_STATS2 | 397 | #ifdef CONFIG_CIFS_STATS2 |
@@ -492,11 +490,17 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
492 | 490 | ||
493 | if (midQ->resp_buf && | 491 | if (midQ->resp_buf && |
494 | (midQ->midState == MID_RESPONSE_RECEIVED)) { | 492 | (midQ->midState == MID_RESPONSE_RECEIVED)) { |
493 | |||
495 | in_buf->smb_buf_length = receive_len; | 494 | in_buf->smb_buf_length = receive_len; |
496 | /* BB verify that length would not overrun small buf */ | 495 | if(receive_len > 500) { |
497 | memcpy((char *)in_buf + 4, | 496 | /* use multiple buffers on way out */ |
498 | (char *)midQ->resp_buf + 4, | 497 | } else { |
499 | receive_len); | 498 | memcpy((char *)in_buf + 4, |
499 | (char *)midQ->resp_buf + 4, | ||
500 | receive_len); | ||
501 | iov[0].iov_len = receive_len + 4; | ||
502 | iov[1].iov_len = 0; | ||
503 | } | ||
500 | 504 | ||
501 | dump_smb(in_buf, 80); | 505 | dump_smb(in_buf, 80); |
502 | /* convert the length into a more usable form */ | 506 | /* convert the length into a more usable form */ |
@@ -549,7 +553,6 @@ out_unlock2: | |||
549 | 553 | ||
550 | return rc; | 554 | return rc; |
551 | } | 555 | } |
552 | #endif /* CIFS_EXPERIMENTAL */ | ||
553 | 556 | ||
554 | int | 557 | int |
555 | SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | 558 | SendReceive(const unsigned int xid, struct cifsSesInfo *ses, |