Lines Matching +full:ref +full:-

1 /* SPDX-License-Identifier: GPL-2.0 */
28 struct dfs_ref *ref; member
32 #define ref_walk_start(w) ((w)->refs)
33 #define ref_walk_end(w) (&(w)->refs[ARRAY_SIZE((w)->refs) - 1])
34 #define ref_walk_cur(w) ((w)->ref)
35 #define ref_walk_descend(w) (--ref_walk_cur(w) >= ref_walk_start(w))
37 #define ref_walk_tit(w) (ref_walk_cur(w)->tit)
39 #define ref_walk_path(w) (ref_walk_cur(w)->path)
40 #define ref_walk_fpath(w) (ref_walk_cur(w)->full_path)
41 #define ref_walk_tl(w) (&ref_walk_cur(w)->tl)
42 #define ref_walk_ses(w) (ref_walk_cur(w)->ses)
50 return ERR_PTR(-ENOMEM); in ref_walk_alloc()
60 static inline void __ref_walk_free(struct dfs_ref *ref) in __ref_walk_free() argument
62 kfree(ref->path); in __ref_walk_free()
63 kfree(ref->full_path); in __ref_walk_free()
64 dfs_cache_free_tgts(&ref->tl); in __ref_walk_free()
65 if (ref->ses) in __ref_walk_free()
66 cifs_put_smb_ses(ref->ses); in __ref_walk_free()
67 memset(ref, 0, sizeof(*ref)); in __ref_walk_free()
72 struct dfs_ref *ref; in ref_walk_free() local
77 for (ref = ref_walk_start(rw); ref <= ref_walk_end(rw); ref++) in ref_walk_free()
78 __ref_walk_free(ref); in ref_walk_free()
84 struct dfs_ref *ref = ref_walk_cur(rw) + 1; in ref_walk_advance() local
86 if (ref > ref_walk_end(rw)) in ref_walk_advance()
87 return -ELOOP; in ref_walk_advance()
88 __ref_walk_free(ref); in ref_walk_advance()
89 ref_walk_cur(rw) = ref; in ref_walk_advance()
97 struct dfs_ref *ref = ref_walk_cur(rw); in ref_walk_next_tgt() local
99 if (!ref->tit) in ref_walk_next_tgt()
100 tit = dfs_cache_get_tgt_iterator(&ref->tl); in ref_walk_next_tgt()
102 tit = dfs_cache_get_next_tgt(&ref->tl, ref->tit); in ref_walk_next_tgt()
103 ref->tit = tit; in ref_walk_next_tgt()
129 struct dfs_ref *ref = ref_walk_start(rw); in ref_walk_set_tcon() local
131 for (; ref <= ref_walk_cur(rw); ref++) { in ref_walk_set_tcon()
132 if (WARN_ON_ONCE(!ref->ses)) in ref_walk_set_tcon()
134 list_add(&ref->ses->dlist, &tcon->dfs_ses_list); in ref_walk_set_tcon()
135 ref->ses = NULL; in ref_walk_set_tcon()
139 int dfs_parse_target_referral(const char *full_path, const struct dfs_info3_param *ref,
145 return dfs_cache_canonical_path(path, cifs_sb->local_nls, cifs_remap(cifs_sb)); in dfs_get_path()
149 struct dfs_info3_param *ref, struct dfs_cache_tgt_list *tl) in dfs_get_referral() argument
151 struct smb3_fs_context *ctx = mnt_ctx->fs_ctx; in dfs_get_referral()
152 struct cifs_sb_info *cifs_sb = mnt_ctx->cifs_sb; in dfs_get_referral()
153 struct cifs_ses *rses = ctx->dfs_root_ses ?: mnt_ctx->ses; in dfs_get_referral()
155 return dfs_cache_find(mnt_ctx->xid, rses, cifs_sb->local_nls, in dfs_get_referral()
156 cifs_remap(cifs_sb), path, ref, tl); in dfs_get_referral()
161 * @ses->dfs_root_ses when a new session is created, so we need to put extra
170 list_del_init(&ses->dlist); in dfs_put_root_smb_sessions()