summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dfs.h
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2022-11-17 17:23:49 +0100
committerSteve French <stfrench@microsoft.com>2022-12-19 15:03:12 +0100
commita1c0d00572fca4adcb40e1fbd3acd481fc75e20b (patch)
tree59d17b23729687930bc2d9d2b7ff28d636dc1cdb /fs/cifs/dfs.h
parentcifs: split out ses and tcon retrieval from mount_get_conns() (diff)
downloadlinux-a1c0d00572fca4adcb40e1fbd3acd481fc75e20b.tar.xz
linux-a1c0d00572fca4adcb40e1fbd3acd481fc75e20b.zip
cifs: share dfs connections and supers
When matching DFS superblocks we can't rely on either the server's address or tcon's UNC name from mount(2) as the existing servers and tcons might be connected to somewhere else. Instead, check if superblock is dfs, and if so, match its original source pathname with the new mount's source pathname. For DFS connections, instead of checking server's address, match its referral path as it could be connected to different targets. Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dfs.h')
-rw-r--r--fs/cifs/dfs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/cifs/dfs.h b/fs/cifs/dfs.h
index af09903b435a..bbe2ec25b0c2 100644
--- a/fs/cifs/dfs.h
+++ b/fs/cifs/dfs.h
@@ -8,9 +8,24 @@
#include "cifsglob.h"
#include "fs_context.h"
+#include "cifs_unicode.h"
int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_param *ref,
struct smb3_fs_context *ctx);
+int dfs_mount_share(struct cifs_mount_ctx *mnt_ctx, bool *isdfs);
+static inline char *dfs_get_path(struct cifs_sb_info *cifs_sb, const char *path)
+{
+ return dfs_cache_canonical_path(path, cifs_sb->local_nls, cifs_remap(cifs_sb));
+}
+
+static inline int dfs_get_referral(struct cifs_mount_ctx *mnt_ctx, const char *path,
+ struct dfs_info3_param *ref, struct dfs_cache_tgt_list *tl)
+{
+ struct cifs_sb_info *cifs_sb = mnt_ctx->cifs_sb;
+
+ return dfs_cache_find(mnt_ctx->xid, mnt_ctx->root_ses, cifs_sb->local_nls,
+ cifs_remap(cifs_sb), path, ref, tl);
+}
#endif /* _CIFS_DFS_H */