summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.org>2026-10-12 00:20:13 -0300
committerPaulo Alcantara <pc@manguebit.org>2026-10-13 00:52:25 -0300
commitb012ffcd45b0c5bb9eeb57ec1e7e2a71d3f36e06 (patch)
tree22ee765ba50428707e70b6734d100ef5c0c6b2f1
parent34c6fdb03b0560c5942945086201bd4caaaa46f8 (diff)
smb: client: drop redundant nls_table arg from CIFSSMBRenameOpenFile()
The nls codepage passed to CIFSSMBRenameOpenFile() is always pTcon->ses->local_nls, so derive it from @pTcon and drop the parameter. 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/cifssmb.c10
-rw-r--r--fs/smb/client/inode.c5
-rw-r--r--fs/smb/client/smb1proto.h3
3 files changed, 8 insertions, 10 deletions
diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c
index dee7c0958284..50ca062a22bf 100644
--- a/fs/smb/client/cifssmb.c
+++ b/fs/smb/client/cifssmb.c
@@ -2545,8 +2545,7 @@ renameRetry:
}
int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
- int netfid, const char *target_name,
- const struct nls_table *nls_codepage, int remap)
+ int netfid, const char *target_name, int remap)
{
struct smb_com_transaction2_sfi_req *pSMB = NULL;
struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
@@ -2595,12 +2594,13 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
sprintf(dummy_string, "cifs%x", pSMB->hdr.Mid);
len_of_str =
cifsConvertToUTF16((__le16 *)rename_info->target_name,
- dummy_string, 24, nls_codepage, remap);
+ dummy_string, 24,
+ pTcon->ses->local_nls, remap);
} else {
len_of_str =
cifsConvertToUTF16((__le16 *)rename_info->target_name,
- target_name, PATH_MAX, nls_codepage,
- remap);
+ target_name, PATH_MAX,
+ pTcon->ses->local_nls, remap);
}
rename_info->target_name_len = cpu_to_le32(2 * len_of_str);
count = sizeof(struct set_file_rename) + (2 * len_of_str);
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 79e7f252641c..43a2d7982488 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -1889,7 +1889,6 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
/* rename the file */
rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, NULL,
- cifs_sb->local_nls,
cifs_remap(cifs_sb));
if (rc != 0) {
rc = -EBUSY;
@@ -1931,7 +1930,7 @@ out:
*/
undo_rename:
CIFSSMBRenameOpenFile(xid, tcon, fid.netfid, dentry->d_name.name,
- cifs_sb->local_nls, cifs_remap(cifs_sb));
+ cifs_remap(cifs_sb));
undo_setattr:
if (dosattr != origattr) {
info_buf->Attributes = cpu_to_le32(origattr);
@@ -2522,7 +2521,7 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,
if (rc == 0) {
rc = CIFSSMBRenameOpenFile(xid, tcon, fid.netfid,
(const char *) to_dentry->d_name.name,
- cifs_sb->local_nls, cifs_remap(cifs_sb));
+ cifs_remap(cifs_sb));
CIFSSMBClose(xid, tcon, fid.netfid);
}
#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
diff --git a/fs/smb/client/smb1proto.h b/fs/smb/client/smb1proto.h
index 3dfabff9533e..7175b458724c 100644
--- a/fs/smb/client/smb1proto.h
+++ b/fs/smb/client/smb1proto.h
@@ -88,8 +88,7 @@ int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
struct dentry *source_dentry, const char *from_name,
const char *to_name, struct cifs_sb_info *cifs_sb);
int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
- int netfid, const char *target_name,
- const struct nls_table *nls_codepage, int remap);
+ int netfid, const char *target_name, int remap);
int CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
const char *fromName, const char *toName,
const struct nls_table *nls_codepage, int remap);