From patchwork Tue May 28 12:11:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2624301 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C430F40077 for ; Tue, 28 May 2013 12:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933554Ab3E1MMN (ORCPT ); Tue, 28 May 2013 08:12:13 -0400 Received: from mail-yh0-f53.google.com ([209.85.213.53]:52890 "EHLO mail-yh0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933343Ab3E1MMM (ORCPT ); Tue, 28 May 2013 08:12:12 -0400 Received: by mail-yh0-f53.google.com with SMTP id f64so879561yha.40 for ; Tue, 28 May 2013 05:12:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=fxuJl2APwGAxKzuCK1055B0UwjSYgeI5e77/GXfsILs=; b=MPSKARw+w9F1QaUep8EUyiKmTEHeHVIGsEsE/f4CqHJ9ZYWkJmUJo1N3HhdXGBEcCX wYcGEdFYTgcewRja9gNl92AddYagiAYTMqG8q21uPug/nizWTXsN5EYyIO26s12DPQ+C BCFqNctlYnr8Qh/hfs2Orfx/KFBuP13tYVzmCvmJz2Zmag1NPhQiqm8e8IbHd9LYpiI+ yiV5QdenD3MhMPCIEV6+f80IqXedpwQ5uR0rB3Zt9S9axm+CeIVIo2F98RKOE6jhuR+G /Kar04mrz9UYiihLluuQR1JgQ3yCbYDwfdczSg81HlA5yDL9l6uysmA7LBGHKCDaU+ao UgCQ== X-Received: by 10.236.31.37 with SMTP id l25mr15717009yha.196.1369743131798; Tue, 28 May 2013 05:12:11 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id d24sm14409623yhi.17.2013.05.28.05.12.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 28 May 2013 05:12:11 -0700 (PDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, idra@samba.org, piastryyy@gmail.com Subject: [PATCH v2 05/19] cifs: remove the cifs_ses->flags field Date: Tue, 28 May 2013 08:11:46 -0400 Message-Id: <1369743120-18941-6-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1369743120-18941-1-git-send-email-jlayton@redhat.com> References: <1369743120-18941-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQkbsHoyrGfPOTXM9Vq9Qrs/af2NchV8T5SUHprQoqveaJrf53EUwTb2l+z3FBnljGW/k6l3 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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 Acked-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 10 ---------- fs/cifs/connect.c | 1 - fs/cifs/sess.c | 7 +------ fs/cifs/smb1ops.c | 18 ++++++------------ 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 29dd111..be993ec 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -692,7 +692,6 @@ struct cifs_ses { enum statusEnum status; unsigned overrideSecFlg; /* if non-zero override global sec flags */ __u16 ipc_tid; /* special tid for connection to IPC share */ - __u16 flags; __u16 vcnum; char *serverOS; /* name of operating system underlying server */ char *serverNOS; /* name of network operating system of server */ @@ -715,15 +714,6 @@ struct cifs_ses { #endif /* CONFIG_CIFS_SMB2 */ }; -/* no more than one of the following three session flags may be set */ -#define CIFS_SES_NT4 1 -#define CIFS_SES_OS2 2 -#define CIFS_SES_W9X 4 -/* following flag is set for old servers such as OS2 (and Win95?) - which do not negotiate NTLM or POSIX dialects, but instead - negotiate one of the older LANMAN dialects */ -#define CIFS_SES_LANMAN 8 - static inline bool cap_unix(struct cifs_ses *ses) { diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c3a405a..118cc9c 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, int rc = -ENOSYS; struct TCP_Server_Info *server = ses->server; - ses->flags = 0; ses->capabilities = server->capabilities; if (linuxExtEnabled == 0) ses->capabilities &= (~server->vals->cap_unix); diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index e8c5dc9..0d0fe38 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, ses->serverOS = kzalloc(len + 1, GFP_KERNEL); if (ses->serverOS) strncpy(ses->serverOS, bcc_ptr, len); - if (strncmp(ses->serverOS, "OS/2", 4) == 0) { + if (strncmp(ses->serverOS, "OS/2", 4) == 0) cifs_dbg(FYI, "OS/2 server\n"); - ses->flags |= CIFS_SES_OS2; - } bcc_ptr += len + 1; bleft -= len + 1; @@ -642,8 +640,6 @@ ssetup_ntlmssp_authenticate: } bcc_ptr = str_area; - ses->flags &= ~CIFS_SES_LANMAN; - iov[1].iov_base = NULL; iov[1].iov_len = 0; @@ -667,7 +663,6 @@ ssetup_ntlmssp_authenticate: ses->server->sec_mode & SECMODE_PW_ENCRYPT ? true : false, lnm_session_key); - ses->flags |= CIFS_SES_LANMAN; memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE); bcc_ptr += CIFS_AUTH_RESP_SIZE; diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 3efdb9d..7d1c78b 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, } tcon = tlink_tcon(tlink); - /* - * NT4 apparently returns success on this call, but it doesn't really - * work. - */ - if (!(tcon->ses->flags & CIFS_SES_NT4)) { - rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, - cifs_sb->local_nls, + rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); - if (rc == 0) { - cinode->cifsAttrs = le32_to_cpu(buf->Attributes); - goto out; - } else if (rc != -EOPNOTSUPP && rc != -EINVAL) - goto out; + if (rc == 0) { + cinode->cifsAttrs = le32_to_cpu(buf->Attributes); + goto out; + } else if (rc != -EOPNOTSUPP && rc != -EINVAL) { + goto out; } cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n");