summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.org>2026-10-12 00:10:57 -0300
committerPaulo Alcantara <pc@manguebit.org>2026-10-13 00:52:24 -0300
commitca67b7abefda27f8e898efc2c7e4e0ade65ab58f (patch)
tree95ac5290796e265d2b74bf77449cb7a2641b906c
parent9f9ab02ddfcbac6174de72745e09dcb460b28c68 (diff)
downloadlinux-ca67b7abefda27f8e898efc2c7e4e0ade65ab58f.tar.gz
linux-ca67b7abefda27f8e898efc2c7e4e0ade65ab58f.zip
smb: client: drop redundant nls_table arg from ->sess_setup()
The nls codepage threaded through ->sess_setup() and stored in sess_data->nls_cp is always ses->local_nls, so derive it from @ses and drop both the parameter and the now-dead sess_data->nls_cp member. Signed-off-by: Paulo Alcantara <pc@manguebit.org> Reviewed-by: David Howells <dhowells@redhat.com> Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Shyam Prasad N <sprasad@microsoft.com> Cc: Tom Talpey <tom@talpey.com> Cc: Bharath SM <bharathsm@microsoft.com>
-rw-r--r--fs/smb/client/cifsglob.h3
-rw-r--r--fs/smb/client/connect.c2
-rw-r--r--fs/smb/client/smb1proto.h3
-rw-r--r--fs/smb/client/smb1session.c9
-rw-r--r--fs/smb/client/smb2pdu.c8
-rw-r--r--fs/smb/client/smb2proto.h3
6 files changed, 9 insertions, 19 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 14865bdbf3fd..6a345ffd51d4 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -373,8 +373,7 @@ struct smb_version_operations {
unsigned int (*negotiate_rsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
/* setup smb sessionn */
int (*sess_setup)(const unsigned int, struct cifs_ses *,
- struct TCP_Server_Info *server,
- const struct nls_table *);
+ struct TCP_Server_Info *server);
/* close smb session */
int (*logoff)(const unsigned int, struct cifs_ses *);
/* connect to a server share */
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 90eda91d9da9..067330fa0069 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -4188,7 +4188,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
if (!rc) {
if (server->ops->sess_setup)
- rc = server->ops->sess_setup(xid, ses, server, nls_info);
+ rc = server->ops->sess_setup(xid, ses, server);
else
rc = -ENOSYS;
}
diff --git a/fs/smb/client/smb1proto.h b/fs/smb/client/smb1proto.h
index ebb2cf396b8f..adaa3fd1ef16 100644
--- a/fs/smb/client/smb1proto.h
+++ b/fs/smb/client/smb1proto.h
@@ -271,8 +271,7 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
* smb1session.c
*/
int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
- struct TCP_Server_Info *server,
- const struct nls_table *nls_cp);
+ struct TCP_Server_Info *server);
/*
* smb1transport.c
diff --git a/fs/smb/client/smb1session.c b/fs/smb/client/smb1session.c
index 2f6eb57dd179..c45d3254dfac 100644
--- a/fs/smb/client/smb1session.c
+++ b/fs/smb/client/smb1session.c
@@ -20,7 +20,6 @@ struct sess_data {
unsigned int xid;
struct cifs_ses *ses;
struct TCP_Server_Info *server;
- struct nls_table *nls_cp;
void (*func)(struct sess_data *);
int result;
unsigned int in_len;
@@ -588,7 +587,7 @@ sess_auth_kerberos(struct sess_data *sess_data)
*bcc_ptr = 0;
bcc_ptr++;
}
- unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp);
+ unicode_oslm_strings(&bcc_ptr, sess_data->ses->local_nls);
unicode_domain_string(&bcc_ptr, ses);
} else {
ascii_oslm_strings(&bcc_ptr);
@@ -686,7 +685,7 @@ _sess_auth_rawntlmssp_assemble_req(struct sess_data *sess_data)
*bcc_ptr = 0;
bcc_ptr++;
}
- unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp);
+ unicode_oslm_strings(&bcc_ptr, sess_data->ses->local_nls);
} else {
ascii_oslm_strings(&bcc_ptr);
}
@@ -948,8 +947,7 @@ static int select_sec(struct sess_data *sess_data)
}
int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
- struct TCP_Server_Info *server,
- const struct nls_table *nls_cp)
+ struct TCP_Server_Info *server)
{
int rc = 0;
struct sess_data *sess_data;
@@ -967,7 +965,6 @@ int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
sess_data->ses = ses;
sess_data->server = server;
sess_data->buf0_type = CIFS_NO_BUFFER;
- sess_data->nls_cp = (struct nls_table *) nls_cp;
rc = select_sec(sess_data);
if (rc)
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 5c06f9d42fc6..cb72735a4553 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -1529,7 +1529,6 @@ struct SMB2_sess_data {
unsigned int xid;
struct cifs_ses *ses;
struct TCP_Server_Info *server;
- struct nls_table *nls_cp;
void (*func)(struct SMB2_sess_data *);
int result;
u64 previous_session;
@@ -2002,10 +2001,8 @@ SMB2_select_sec(struct SMB2_sess_data *sess_data)
return 0;
}
-int
-SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
- struct TCP_Server_Info *server,
- const struct nls_table *nls_cp)
+int SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
+ struct TCP_Server_Info *server)
{
int rc = 0;
struct SMB2_sess_data *sess_data;
@@ -2025,7 +2022,6 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
sess_data->ses = ses;
sess_data->server = server;
sess_data->buf0_type = CIFS_NO_BUFFER;
- sess_data->nls_cp = (struct nls_table *) nls_cp;
sess_data->previous_session = ses->Suid;
rc = SMB2_select_sec(sess_data);
diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h
index 69a32f8311ca..aa1340fec27b 100644
--- a/fs/smb/client/smb2proto.h
+++ b/fs/smb/client/smb2proto.h
@@ -131,8 +131,7 @@ bool smb2_should_replay(struct cifs_tcon *tcon, int *pretries,
int SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses,
struct TCP_Server_Info *server);
int SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
- struct TCP_Server_Info *server,
- const struct nls_table *nls_cp);
+ struct TCP_Server_Info *server);
int SMB2_logoff(const unsigned int xid, struct cifs_ses *ses);
int SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
struct cifs_tcon *tcon, const struct nls_table *cp);