diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2020-12-14 16:40:20 +1000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-14 09:26:30 -0600 |
commit | 387ec58f339b0c45e3767395f11fa8dd3772131e (patch) | |
tree | 808eac5e8e9b9b574f6522c3f3e167b691b6cf87 /fs/cifs/connect.c | |
parent | 9ccecae8d1d7131439fb4849f51e614ef7395298 (diff) | |
download | lwn-387ec58f339b0c45e3767395f11fa8dd3772131e.tar.gz lwn-387ec58f339b0c45e3767395f11fa8dd3772131e.zip |
cifs: simplify handling of cifs_sb/ctx->local_nls
Only load/unload local_nls from cifs_sb and just make the ctx
contain a pointer to cifs_sb->ctx.
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index eb036cf0f631..2d43c313f13d 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2717,7 +2717,19 @@ int cifs_setup_cifs_sb(struct smb3_fs_context *ctx, cifs_dbg(FYI, "file mode: %04ho dir mode: %04ho\n", cifs_sb->ctx->file_mode, cifs_sb->ctx->dir_mode); - cifs_sb->local_nls = ctx->local_nls; + /* this is needed for ASCII cp to Unicode converts */ + if (ctx->iocharset == NULL) { + /* load_nls_default cannot return null */ + cifs_sb->local_nls = load_nls_default(); + } else { + cifs_sb->local_nls = load_nls(ctx->iocharset); + if (cifs_sb->local_nls == NULL) { + cifs_dbg(VFS, "CIFS mount error: iocharset %s not found\n", + ctx->iocharset); + return -ELIBACC; + } + } + ctx->local_nls = cifs_sb->local_nls; if (ctx->nodfs) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_DFS; @@ -3187,19 +3199,6 @@ cifs_setup_volume_info(struct smb3_fs_context *ctx) return -EINVAL; } - /* this is needed for ASCII cp to Unicode converts */ - if (ctx->iocharset == NULL) { - /* load_nls_default cannot return null */ - ctx->local_nls = load_nls_default(); - } else { - ctx->local_nls = load_nls(ctx->iocharset); - if (ctx->local_nls == NULL) { - cifs_dbg(VFS, "CIFS mount error: iocharset %s not found\n", - ctx->iocharset); - return -ELIBACC; - } - } - return rc; } @@ -3521,7 +3520,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) out: free_xid(xid); - cifs_try_adding_channels(ses); + cifs_try_adding_channels(cifs_sb, ses); return mount_setup_tlink(cifs_sb, ses, tcon); error: |