cifs: do not pass cifs_sb when trying to add channels
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 6 Nov 2023 16:22:11 +0000 (16:22 +0000)
committerSteve French <stfrench@microsoft.com>
Thu, 9 Nov 2023 16:25:21 +0000 (10:25 -0600)
The only reason why cifs_sb gets passed today to cifs_try_adding_channels
is to pass the local_nls field for the new channels and binding session.
However, the ses struct already has local_nls field that is setup during
the first cifs_setup_session. So there is no need to pass cifs_sb.

This change removes cifs_sb from the arg list for this and the functions
that it calls and uses ses->local_nls instead.

Cc: stable@vger.kernel.org
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsproto.h
fs/smb/client/connect.c
fs/smb/client/sess.c

index c1f71c6be7e353e788e0d1f704f4cec7e033d59d..eed8dbb6b2fbe3e4dcf69376f52a6407d3b1f7f9 100644 (file)
@@ -610,7 +610,7 @@ void cifs_free_hash(struct shash_desc **sdesc);
 
 struct cifs_chan *
 cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server);
-int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses);
+int cifs_try_adding_channels(struct cifs_ses *ses);
 bool is_server_using_iface(struct TCP_Server_Info *server,
                           struct cifs_server_iface *iface);
 bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface);
index 3ff82f0aa00e8dc49ead272237c2afad5cb6f0dd..947e3c362bebb5f8d6aa8ddc2b3a0e0b91a8c6b9 100644 (file)
@@ -3564,7 +3564,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
        ctx->prepath = NULL;
 
 out:
-       cifs_try_adding_channels(cifs_sb, mnt_ctx.ses);
+       cifs_try_adding_channels(mnt_ctx.ses);
        rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon);
        if (rc)
                goto error;
index e716d046fb5f5bc7439028f333873c99df08aa4a..fe45ccfdc8029b7a7e42ee0b5da3f69f69fd15e8 100644 (file)
@@ -24,7 +24,7 @@
 #include "fs_context.h"
 
 static int
-cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
+cifs_ses_add_channel(struct cifs_ses *ses,
                     struct cifs_server_iface *iface);
 
 bool
@@ -172,7 +172,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses,
 }
 
 /* returns number of channels added */
-int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
+int cifs_try_adding_channels(struct cifs_ses *ses)
 {
        struct TCP_Server_Info *server = ses->server;
        int old_chan_count, new_chan_count;
@@ -255,7 +255,7 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
                        kref_get(&iface->refcount);
 
                        spin_unlock(&ses->iface_lock);
-                       rc = cifs_ses_add_channel(cifs_sb, ses, iface);
+                       rc = cifs_ses_add_channel(ses, iface);
                        spin_lock(&ses->iface_lock);
 
                        if (rc) {
@@ -458,7 +458,7 @@ cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server)
 }
 
 static int
-cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
+cifs_ses_add_channel(struct cifs_ses *ses,
                     struct cifs_server_iface *iface)
 {
        struct TCP_Server_Info *chan_server;
@@ -537,7 +537,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
         * This will be used for encoding/decoding user/domain/pw
         * during sess setup auth.
         */
-       ctx->local_nls = cifs_sb->local_nls;
+       ctx->local_nls = ses->local_nls;
 
        /* Use RDMA if possible */
        ctx->rdma = iface->rdma_capable;
@@ -583,7 +583,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
 
        rc = cifs_negotiate_protocol(xid, ses, chan->server);
        if (!rc)
-               rc = cifs_setup_session(xid, ses, chan->server, cifs_sb->local_nls);
+               rc = cifs_setup_session(xid, ses, chan->server, ses->local_nls);
 
        mutex_unlock(&ses->session_mutex);