diff options
author | Steve French <smfrench@gmail.com> | 2012-11-29 00:21:06 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-12-05 14:27:29 -0500 |
commit | dd446b16edd74ca525208d924d426f786dd973f8 (patch) | |
tree | 5699eb645592ce2cc078ced6a91df6916ff577ae /fs/cifs | |
parent | 21cb2d90c76cbc951da3a266f0dd439d64f3114a (diff) |
Add SMB2.02 dialect support
This patch enables optional for original SMB2 (SMB2.02) dialect
by specifying vers=2.0 on mount.
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsglob.h | 1 | ||||
-rw-r--r-- | fs/cifs/connect.c | 5 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 17 |
3 files changed, 23 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index d1a93d32db81..ac66409fb9d3 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -178,6 +178,7 @@ struct smb_rqst { | |||
178 | 178 | ||
179 | enum smb_version { | 179 | enum smb_version { |
180 | Smb_1 = 1, | 180 | Smb_1 = 1, |
181 | Smb_20, | ||
181 | Smb_21, | 182 | Smb_21, |
182 | Smb_30, | 183 | Smb_30, |
183 | }; | 184 | }; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5ce5686353f1..d01c7328dbae 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -274,6 +274,7 @@ static const match_table_t cifs_cacheflavor_tokens = { | |||
274 | 274 | ||
275 | static const match_table_t cifs_smb_version_tokens = { | 275 | static const match_table_t cifs_smb_version_tokens = { |
276 | { Smb_1, SMB1_VERSION_STRING }, | 276 | { Smb_1, SMB1_VERSION_STRING }, |
277 | { Smb_20, SMB20_VERSION_STRING}, | ||
277 | { Smb_21, SMB21_VERSION_STRING }, | 278 | { Smb_21, SMB21_VERSION_STRING }, |
278 | { Smb_30, SMB30_VERSION_STRING }, | 279 | { Smb_30, SMB30_VERSION_STRING }, |
279 | }; | 280 | }; |
@@ -1074,6 +1075,10 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) | |||
1074 | vol->vals = &smb1_values; | 1075 | vol->vals = &smb1_values; |
1075 | break; | 1076 | break; |
1076 | #ifdef CONFIG_CIFS_SMB2 | 1077 | #ifdef CONFIG_CIFS_SMB2 |
1078 | case Smb_20: | ||
1079 | vol->ops = &smb21_operations; /* currently identical with 2.1 */ | ||
1080 | vol->vals = &smb20_values; | ||
1081 | break; | ||
1077 | case Smb_21: | 1082 | case Smb_21: |
1078 | vol->ops = &smb21_operations; | 1083 | vol->ops = &smb21_operations; |
1079 | vol->vals = &smb21_values; | 1084 | vol->vals = &smb21_values; |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 137aaf8d6f38..ad4d96a4bff5 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -625,6 +625,23 @@ struct smb_version_operations smb21_operations = { | |||
625 | .new_lease_key = smb2_new_lease_key, | 625 | .new_lease_key = smb2_new_lease_key, |
626 | }; | 626 | }; |
627 | 627 | ||
628 | struct smb_version_values smb20_values = { | ||
629 | .version_string = SMB20_VERSION_STRING, | ||
630 | .protocol_id = SMB20_PROT_ID, | ||
631 | .req_capabilities = 0, /* MBZ */ | ||
632 | .large_lock_type = 0, | ||
633 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
634 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
635 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
636 | .header_size = sizeof(struct smb2_hdr), | ||
637 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
638 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
639 | .lock_cmd = SMB2_LOCK, | ||
640 | .cap_unix = 0, | ||
641 | .cap_nt_find = SMB2_NT_FIND, | ||
642 | .cap_large_files = SMB2_LARGE_FILES, | ||
643 | }; | ||
644 | |||
628 | struct smb_version_values smb21_values = { | 645 | struct smb_version_values smb21_values = { |
629 | .version_string = SMB21_VERSION_STRING, | 646 | .version_string = SMB21_VERSION_STRING, |
630 | .protocol_id = SMB21_PROT_ID, | 647 | .protocol_id = SMB21_PROT_ID, |