summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dfs_cache.h
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.com>2023-04-27 09:40:08 +0200
committerSteve French <stfrench@microsoft.com>2023-05-04 06:29:47 +0200
commit6be2ea33a4093402252724a00c4af8033725184c (patch)
tree79c111db007aed6fab0cb82837480909e17eaabb /fs/cifs/dfs_cache.h
parentcifs: protect access of TCP_Server_Info::{origin,leaf}_fullpath (diff)
downloadlinux-6be2ea33a4093402252724a00c4af8033725184c.tar.xz
linux-6be2ea33a4093402252724a00c4af8033725184c.zip
cifs: avoid potential races when handling multiple dfs tcons
Now that a DFS tcon manages its own list of DFS referrals and sessions, there is no point in having a single worker to refresh referrals of all DFS tcons. Make it faster and less prone to race conditions when having several mounts by queueing a worker per DFS tcon that will take care of refreshing only the DFS referrals related to it. Cc: stable@vger.kernel.org # v6.2+ Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dfs_cache.h')
-rw-r--r--fs/cifs/dfs_cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/dfs_cache.h b/fs/cifs/dfs_cache.h
index e0d39393035a..c6d89cd6d4fd 100644
--- a/fs/cifs/dfs_cache.h
+++ b/fs/cifs/dfs_cache.h
@@ -13,6 +13,9 @@
#include <linux/uuid.h>
#include "cifsglob.h"
+extern struct workqueue_struct *dfscache_wq;
+extern atomic_t dfs_cache_ttl;
+
#define DFS_CACHE_TGT_LIST_INIT(var) { .tl_numtgts = 0, .tl_list = LIST_HEAD_INIT((var).tl_list), }
struct dfs_cache_tgt_list {
@@ -42,6 +45,7 @@ int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it,
char **prefix);
char *dfs_cache_canonical_path(const char *path, const struct nls_table *cp, int remap);
int dfs_cache_remount_fs(struct cifs_sb_info *cifs_sb);
+void dfs_cache_refresh(struct work_struct *work);
static inline struct dfs_cache_tgt_iterator *
dfs_cache_get_next_tgt(struct dfs_cache_tgt_list *tl,
@@ -89,4 +93,9 @@ dfs_cache_get_nr_tgts(const struct dfs_cache_tgt_list *tl)
return tl ? tl->tl_numtgts : 0;
}
+static inline int dfs_cache_get_ttl(void)
+{
+ return atomic_read(&dfs_cache_ttl);
+}
+
#endif /* _CIFS_DFS_CACHE_H */