diff options
author | Steve French <sfrench@us.ibm.com> | 2011-02-24 13:07:19 -0500 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-23 04:33:15 -0400 |
commit | 1080ef758fb87f286b25277d8373e680a9e73363 (patch) | |
tree | d15de03210e986f0acd64afecf930160df2ceaf2 /fs/cifs/connect.c | |
parent | 675f36fb1dfc14eb9f6136cbac505e819ae4be9d (diff) |
CIFS: Introduce SMB2 mounts as vers=2.1
As with Linux nfs client, which uses "nfsvers=" or "vers=" to
indicate which protocol to use for mount, specifying
"vers=2.1"
will force an SMB2 mount. When vers is not specified CIFS is used
"vers=1"
We can eventually autonegotiate down from SMB2 to CIFS
when SMB2 is stable enough to make it the default, but this
is for the future. At that time we could also implement a
"maxprotocol" mount option as smbclient and Samba have today,
but that would be premature until SMB2 is stable.
Intially the SMB2 Kconfig option will depend on "BROKEN"
until the merge is complete, and then be "EXPERIMENTAL"
When it is no longer experimental we can consider changing
the default protocol to attempt first.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c71c11c9caab..ccafdedd0dbc 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fs/cifs/connect.c | 2 | * fs/cifs/connect.c |
3 | * | 3 | * |
4 | * Copyright (C) International Business Machines Corp., 2002,2009 | 4 | * Copyright (C) International Business Machines Corp., 2002,2011 |
5 | * Author(s): Steve French (sfrench@us.ibm.com) | 5 | * Author(s): Steve French (sfrench@us.ibm.com) |
6 | * | 6 | * |
7 | * This library is free software; you can redistribute it and/or modify | 7 | * This library is free software; you can redistribute it and/or modify |
@@ -278,6 +278,7 @@ static const match_table_t cifs_cacheflavor_tokens = { | |||
278 | 278 | ||
279 | static const match_table_t cifs_smb_version_tokens = { | 279 | static const match_table_t cifs_smb_version_tokens = { |
280 | { Smb_1, SMB1_VERSION_STRING }, | 280 | { Smb_1, SMB1_VERSION_STRING }, |
281 | { Smb_21, SMB21_VERSION_STRING }, | ||
281 | }; | 282 | }; |
282 | 283 | ||
283 | static int ip_connect(struct TCP_Server_Info *server); | 284 | static int ip_connect(struct TCP_Server_Info *server); |
@@ -1221,6 +1222,12 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) | |||
1221 | vol->ops = &smb1_operations; | 1222 | vol->ops = &smb1_operations; |
1222 | vol->vals = &smb1_values; | 1223 | vol->vals = &smb1_values; |
1223 | break; | 1224 | break; |
1225 | #ifdef CONFIG_CIFS_SMB2 | ||
1226 | case Smb_21: | ||
1227 | vol->ops = &smb21_operations; | ||
1228 | vol->vals = &smb21_values; | ||
1229 | break; | ||
1230 | #endif | ||
1224 | default: | 1231 | default: |
1225 | cERROR(1, "Unknown vers= option specified: %s", value); | 1232 | cERROR(1, "Unknown vers= option specified: %s", value); |
1226 | return 1; | 1233 | return 1; |