aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-05-26 07:00:56 -0400
committerSteve French <smfrench@gmail.com>2013-06-24 02:56:40 -0400
commit281e2e7d06c42ce8dfd423fa2ae5616af0e0323f (patch)
tree78fdcb02c458429c3cc0260ffaba5e852057a332
parent3534b8508e4b21eec0b7b839f7234a9b6fe27d03 (diff)
cifs: remove the cifs_ses->flags field
This field is completely unused: CIFS_SES_W9X is completely unused. CIFS_SES_LANMAN and CIFS_SES_OS2 are set but never checked. CIFS_SES_NT4 is checked, but never set. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifsglob.h10
-rw-r--r--fs/cifs/connect.c1
-rw-r--r--fs/cifs/sess.c7
-rw-r--r--fs/cifs/smb1ops.c18
4 files changed, 7 insertions, 29 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 29dd1113e40d..be993ec5895b 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -692,7 +692,6 @@ struct cifs_ses {
692 enum statusEnum status; 692 enum statusEnum status;
693 unsigned overrideSecFlg; /* if non-zero override global sec flags */ 693 unsigned overrideSecFlg; /* if non-zero override global sec flags */
694 __u16 ipc_tid; /* special tid for connection to IPC share */ 694 __u16 ipc_tid; /* special tid for connection to IPC share */
695 __u16 flags;
696 __u16 vcnum; 695 __u16 vcnum;
697 char *serverOS; /* name of operating system underlying server */ 696 char *serverOS; /* name of operating system underlying server */
698 char *serverNOS; /* name of network operating system of server */ 697 char *serverNOS; /* name of network operating system of server */
@@ -715,15 +714,6 @@ struct cifs_ses {
715#endif /* CONFIG_CIFS_SMB2 */ 714#endif /* CONFIG_CIFS_SMB2 */
716}; 715};
717 716
718/* no more than one of the following three session flags may be set */
719#define CIFS_SES_NT4 1
720#define CIFS_SES_OS2 2
721#define CIFS_SES_W9X 4
722/* following flag is set for old servers such as OS2 (and Win95?)
723 which do not negotiate NTLM or POSIX dialects, but instead
724 negotiate one of the older LANMAN dialects */
725#define CIFS_SES_LANMAN 8
726
727static inline bool 717static inline bool
728cap_unix(struct cifs_ses *ses) 718cap_unix(struct cifs_ses *ses)
729{ 719{
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 180d9b95fab0..160134902233 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3834,7 +3834,6 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
3834 int rc = -ENOSYS; 3834 int rc = -ENOSYS;
3835 struct TCP_Server_Info *server = ses->server; 3835 struct TCP_Server_Info *server = ses->server;
3836 3836
3837 ses->flags = 0;
3838 ses->capabilities = server->capabilities; 3837 ses->capabilities = server->capabilities;
3839 if (linuxExtEnabled == 0) 3838 if (linuxExtEnabled == 0)
3840 ses->capabilities &= (~server->vals->cap_unix); 3839 ses->capabilities &= (~server->vals->cap_unix);
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index e8c5dc9f3386..0d0fe38f66a2 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -328,10 +328,8 @@ static void decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
328 ses->serverOS = kzalloc(len + 1, GFP_KERNEL); 328 ses->serverOS = kzalloc(len + 1, GFP_KERNEL);
329 if (ses->serverOS) 329 if (ses->serverOS)
330 strncpy(ses->serverOS, bcc_ptr, len); 330 strncpy(ses->serverOS, bcc_ptr, len);
331 if (strncmp(ses->serverOS, "OS/2", 4) == 0) { 331 if (strncmp(ses->serverOS, "OS/2", 4) == 0)
332 cifs_dbg(FYI, "OS/2 server\n"); 332 cifs_dbg(FYI, "OS/2 server\n");
333 ses->flags |= CIFS_SES_OS2;
334 }
335 333
336 bcc_ptr += len + 1; 334 bcc_ptr += len + 1;
337 bleft -= len + 1; 335 bleft -= len + 1;
@@ -642,8 +640,6 @@ ssetup_ntlmssp_authenticate:
642 } 640 }
643 bcc_ptr = str_area; 641 bcc_ptr = str_area;
644 642
645 ses->flags &= ~CIFS_SES_LANMAN;
646
647 iov[1].iov_base = NULL; 643 iov[1].iov_base = NULL;
648 iov[1].iov_len = 0; 644 iov[1].iov_len = 0;
649 645
@@ -667,7 +663,6 @@ ssetup_ntlmssp_authenticate:
667 ses->server->sec_mode & SECMODE_PW_ENCRYPT ? 663 ses->server->sec_mode & SECMODE_PW_ENCRYPT ?
668 true : false, lnm_session_key); 664 true : false, lnm_session_key);
669 665
670 ses->flags |= CIFS_SES_LANMAN;
671 memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE); 666 memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE);
672 bcc_ptr += CIFS_AUTH_RESP_SIZE; 667 bcc_ptr += CIFS_AUTH_RESP_SIZE;
673 668
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 3efdb9d5c0b8..7d1c78bce4ae 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -765,20 +765,14 @@ smb_set_file_info(struct inode *inode, const char *full_path,
765 } 765 }
766 tcon = tlink_tcon(tlink); 766 tcon = tlink_tcon(tlink);
767 767
768 /* 768 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls,
769 * NT4 apparently returns success on this call, but it doesn't really
770 * work.
771 */
772 if (!(tcon->ses->flags & CIFS_SES_NT4)) {
773 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf,
774 cifs_sb->local_nls,
775 cifs_sb->mnt_cifs_flags & 769 cifs_sb->mnt_cifs_flags &
776 CIFS_MOUNT_MAP_SPECIAL_CHR); 770 CIFS_MOUNT_MAP_SPECIAL_CHR);
777 if (rc == 0) { 771 if (rc == 0) {
778 cinode->cifsAttrs = le32_to_cpu(buf->Attributes); 772 cinode->cifsAttrs = le32_to_cpu(buf->Attributes);
779 goto out; 773 goto out;
780 } else if (rc != -EOPNOTSUPP && rc != -EINVAL) 774 } else if (rc != -EOPNOTSUPP && rc != -EINVAL) {
781 goto out; 775 goto out;
782 } 776 }
783 777
784 cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n"); 778 cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n");