diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2014-06-05 11:03:27 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-08-02 02:23:03 -0400 |
commit | cb7e9eabb2b584884db0d11ae0376d31ac1cfdc1 (patch) | |
tree | 4f6fd78f74b173359dd673b8bf49b8f188aab0be /fs/cifs/smb2transport.c | |
parent | 6ec0b01b2691d1465bb7219e031e8bf38ccd9397 (diff) |
CIFS: Use multicredits for SMB 2.1/3 writes
If we negotiate SMB 2.1 and higher version of the protocol and
a server supports large write buffer size, we need to consume 1
credit per 65536 bytes. So, we need to know how many credits
we have and obtain the required number of them before constructing
a writedata structure in writepages and iovec write.
Reviewed-by: Shirish Pargaonkar <spargaonkar@suse.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2transport.c')
-rw-r--r-- | fs/cifs/smb2transport.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c index 59c748ce872f..5111e7272db6 100644 --- a/fs/cifs/smb2transport.c +++ b/fs/cifs/smb2transport.c | |||
@@ -466,7 +466,12 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) | |||
466 | static inline void | 466 | static inline void |
467 | smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr) | 467 | smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr) |
468 | { | 468 | { |
469 | unsigned int i, num = le16_to_cpu(hdr->CreditCharge); | ||
470 | |||
469 | hdr->MessageId = get_next_mid64(server); | 471 | hdr->MessageId = get_next_mid64(server); |
472 | /* skip message numbers according to CreditCharge field */ | ||
473 | for (i = 1; i < num; i++) | ||
474 | get_next_mid(server); | ||
470 | } | 475 | } |
471 | 476 | ||
472 | static struct mid_q_entry * | 477 | static struct mid_q_entry * |