aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2021-11-16 13:38:58 -0300
committerSteve French <stfrench@microsoft.com>2021-11-16 10:57:08 -0600
commit8ae87bbeb5d1bfd4ddf2f73f72be51d02d6be2eb (patch)
tree85dc294eabd65bf74decdc3e214d6697e7e6b933 /fs/cifs/connect.c
parentcifs: protect srv_count with cifs_tcp_ses_lock (diff)
downloadlinux-dev-8ae87bbeb5d1bfd4ddf2f73f72be51d02d6be2eb.tar.xz
linux-dev-8ae87bbeb5d1bfd4ddf2f73f72be51d02d6be2eb.zip
cifs: introduce cifs_ses_mark_for_reconnect() helper
Use new cifs_ses_mark_for_reconnect() helper to mark all session channels for reconnect instead of duplicating it in different places. Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b98711b62897..67e4c5548e9d 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -4113,18 +4113,6 @@ cifs_prune_tlinks(struct work_struct *work)
}
#ifdef CONFIG_CIFS_DFS_UPCALL
-static void mark_tcon_tcp_ses_for_reconnect(struct cifs_tcon *tcon)
-{
- int i;
-
- for (i = 0; i < tcon->ses->chan_count; i++) {
- spin_lock(&GlobalMid_Lock);
- if (tcon->ses->chans[i].server->tcpStatus != CifsExiting)
- tcon->ses->chans[i].server->tcpStatus = CifsNeedReconnect;
- spin_unlock(&GlobalMid_Lock);
- }
-}
-
/* Update dfs referral path of superblock */
static int update_server_fullpath(struct TCP_Server_Info *server, struct cifs_sb_info *cifs_sb,
const char *target)
@@ -4301,7 +4289,7 @@ static int tree_connect_dfs_target(const unsigned int xid, struct cifs_tcon *tco
*/
if (rc && server->current_fullpath != server->origin_fullpath) {
server->current_fullpath = server->origin_fullpath;
- mark_tcon_tcp_ses_for_reconnect(tcon);
+ cifs_ses_mark_for_reconnect(tcon->ses);
}
dfs_cache_free_tgts(tl);