Commit 7ef93ffc authored by Steve French's avatar Steve French

cifs: version operations for smb20 unneeded when legacy support disabled

We should not be including unused smb20 specific code when legacy
support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned
off).  For example smb2_operations and smb2_values aren't used
in that case.  Over time we can move more and more SMB1/CIFS and SMB2.0
code into the insecure legacy ifdefs
Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 387ba9bf
...@@ -1963,11 +1963,13 @@ extern mempool_t *cifs_mid_poolp; ...@@ -1963,11 +1963,13 @@ extern mempool_t *cifs_mid_poolp;
/* Operations for different SMB versions */ /* Operations for different SMB versions */
#define SMB1_VERSION_STRING "1.0" #define SMB1_VERSION_STRING "1.0"
#define SMB20_VERSION_STRING "2.0"
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
extern struct smb_version_operations smb1_operations; extern struct smb_version_operations smb1_operations;
extern struct smb_version_values smb1_values; extern struct smb_version_values smb1_values;
#define SMB20_VERSION_STRING "2.0"
extern struct smb_version_operations smb20_operations; extern struct smb_version_operations smb20_operations;
extern struct smb_version_values smb20_values; extern struct smb_version_values smb20_values;
#endif /* CIFS_ALLOW_INSECURE_LEGACY */
#define SMB21_VERSION_STRING "2.1" #define SMB21_VERSION_STRING "2.1"
extern struct smb_version_operations smb21_operations; extern struct smb_version_operations smb21_operations;
extern struct smb_version_values smb21_values; extern struct smb_version_values smb21_values;
......
...@@ -4345,11 +4345,13 @@ smb3_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock, ...@@ -4345,11 +4345,13 @@ smb3_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock,
} }
} }
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
static bool static bool
smb2_is_read_op(__u32 oplock) smb2_is_read_op(__u32 oplock)
{ {
return oplock == SMB2_OPLOCK_LEVEL_II; return oplock == SMB2_OPLOCK_LEVEL_II;
} }
#endif /* CIFS_ALLOW_INSECURE_LEGACY */
static bool static bool
smb21_is_read_op(__u32 oplock) smb21_is_read_op(__u32 oplock)
...@@ -5448,7 +5450,7 @@ smb2_make_node(unsigned int xid, struct inode *inode, ...@@ -5448,7 +5450,7 @@ smb2_make_node(unsigned int xid, struct inode *inode,
return rc; return rc;
} }
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
struct smb_version_operations smb20_operations = { struct smb_version_operations smb20_operations = {
.compare_fids = smb2_compare_fids, .compare_fids = smb2_compare_fids,
.setup_request = smb2_setup_request, .setup_request = smb2_setup_request,
...@@ -5547,6 +5549,7 @@ struct smb_version_operations smb20_operations = { ...@@ -5547,6 +5549,7 @@ struct smb_version_operations smb20_operations = {
.is_status_io_timeout = smb2_is_status_io_timeout, .is_status_io_timeout = smb2_is_status_io_timeout,
.is_network_name_deleted = smb2_is_network_name_deleted, .is_network_name_deleted = smb2_is_network_name_deleted,
}; };
#endif /* CIFS_ALLOW_INSECURE_LEGACY */
struct smb_version_operations smb21_operations = { struct smb_version_operations smb21_operations = {
.compare_fids = smb2_compare_fids, .compare_fids = smb2_compare_fids,
...@@ -5878,6 +5881,7 @@ struct smb_version_operations smb311_operations = { ...@@ -5878,6 +5881,7 @@ struct smb_version_operations smb311_operations = {
.is_network_name_deleted = smb2_is_network_name_deleted, .is_network_name_deleted = smb2_is_network_name_deleted,
}; };
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
struct smb_version_values smb20_values = { struct smb_version_values smb20_values = {
.version_string = SMB20_VERSION_STRING, .version_string = SMB20_VERSION_STRING,
.protocol_id = SMB20_PROT_ID, .protocol_id = SMB20_PROT_ID,
...@@ -5898,6 +5902,7 @@ struct smb_version_values smb20_values = { ...@@ -5898,6 +5902,7 @@ struct smb_version_values smb20_values = {
.signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED,
.create_lease_size = sizeof(struct create_lease), .create_lease_size = sizeof(struct create_lease),
}; };
#endif /* ALLOW_INSECURE_LEGACY */
struct smb_version_values smb21_values = { struct smb_version_values smb21_values = {
.version_string = SMB21_VERSION_STRING, .version_string = SMB21_VERSION_STRING,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment