From 585f5700abdab15d1b22f0ac5ba7cf73fa7e8c12 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 24 Feb 2011 18:07:19 +0000 Subject: [PATCH] --- yaml --- r: 308815 b: refs/heads/master c: 1080ef758fb87f286b25277d8373e680a9e73363 h: refs/heads/master i: 308813: a9bda52c0f22f091ce0734420844fa47936fe8ba 308811: 35cef1c57be30e10506abaa091f23f3cafc6bbf9 308807: 949b3e31ede30eabcc428e7aadb761fdb2f8dd8c 308799: b260600ac51792ea8c7a1225ff0099d3b3c9a76b v: v3 --- [refs] | 2 +- trunk/fs/cifs/Makefile | 2 ++ trunk/fs/cifs/cifsglob.h | 4 ++++ trunk/fs/cifs/connect.c | 9 ++++++++- trunk/fs/cifs/smb2ops.c | 27 +++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 trunk/fs/cifs/smb2ops.c diff --git a/[refs] b/[refs] index 250e7297661a..b89ee1427cac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 675f36fb1dfc14eb9f6136cbac505e819ae4be9d +refs/heads/master: 1080ef758fb87f286b25277d8373e680a9e73363 diff --git a/trunk/fs/cifs/Makefile b/trunk/fs/cifs/Makefile index 0fe70258caf0..4b4127544349 100644 --- a/trunk/fs/cifs/Makefile +++ b/trunk/fs/cifs/Makefile @@ -15,3 +15,5 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o + +cifs-$(CONFIG_CIFS_SMB2) += smb2ops.o diff --git a/trunk/fs/cifs/cifsglob.h b/trunk/fs/cifs/cifsglob.h index 2396456c4edc..c0a027ec63c8 100644 --- a/trunk/fs/cifs/cifsglob.h +++ b/trunk/fs/cifs/cifsglob.h @@ -152,6 +152,7 @@ struct cifs_cred { enum smb_version { Smb_1 = 1, + Smb_21, }; struct mid_q_entry; @@ -1122,4 +1123,7 @@ extern struct workqueue_struct *cifsiod_wq; #define SMB1_VERSION_STRING "1.0" extern struct smb_version_operations smb1_operations; extern struct smb_version_values smb1_values; +#define SMB21_VERSION_STRING "2.1" +extern struct smb_version_operations smb21_operations; +extern struct smb_version_values smb21_values; #endif /* _CIFS_GLOB_H */ diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index c71c11c9caab..ccafdedd0dbc 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -1,7 +1,7 @@ /* * fs/cifs/connect.c * - * Copyright (C) International Business Machines Corp., 2002,2009 + * Copyright (C) International Business Machines Corp., 2002,2011 * Author(s): Steve French (sfrench@us.ibm.com) * * This library is free software; you can redistribute it and/or modify @@ -278,6 +278,7 @@ static const match_table_t cifs_cacheflavor_tokens = { static const match_table_t cifs_smb_version_tokens = { { Smb_1, SMB1_VERSION_STRING }, + { Smb_21, SMB21_VERSION_STRING }, }; static int ip_connect(struct TCP_Server_Info *server); @@ -1221,6 +1222,12 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) vol->ops = &smb1_operations; vol->vals = &smb1_values; break; +#ifdef CONFIG_CIFS_SMB2 + case Smb_21: + vol->ops = &smb21_operations; + vol->vals = &smb21_values; + break; +#endif default: cERROR(1, "Unknown vers= option specified: %s", value); return 1; diff --git a/trunk/fs/cifs/smb2ops.c b/trunk/fs/cifs/smb2ops.c new file mode 100644 index 000000000000..f065e89756a1 --- /dev/null +++ b/trunk/fs/cifs/smb2ops.c @@ -0,0 +1,27 @@ +/* + * SMB2 version specific operations + * + * Copyright (c) 2012, Jeff Layton + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License v2 as published + * by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "cifsglob.h" + +struct smb_version_operations smb21_operations = { +}; + +struct smb_version_values smb21_values = { + .version_string = SMB21_VERSION_STRING, +};