Lines Matching refs:path
38 const char *path; member
82 static int get_normalized_path(const char *path, char **npath) in get_normalized_path() argument
84 if (!path || strlen(path) < 3 || (*path != '\\' && *path != '/')) in get_normalized_path()
87 if (*path == '\\') { in get_normalized_path()
88 *npath = (char *)path; in get_normalized_path()
90 *npath = kstrndup(path, strlen(path), GFP_KERNEL); in get_normalized_path()
98 static inline void free_normalized_path(const char *path, char *npath) in free_normalized_path() argument
100 if (path != npath) in free_normalized_path()
126 kfree(ce->path); in flush_cache_ent()
170 ce->path, in dfscache_proc_show()
239 ce->path, in dump_ce()
322 static inline bool is_sysvol_or_netlogon(const char *path) in is_sysvol_or_netlogon() argument
325 char sep = path[0]; in is_sysvol_or_netlogon()
327 s = strchr(path + 1, sep) + 1; in is_sysvol_or_netlogon()
410 static struct cache_entry *alloc_cache_entry(const char *path, in alloc_cache_entry() argument
421 ce->path = kstrndup(path, strlen(path), GFP_KERNEL); in alloc_cache_entry()
422 if (!ce->path) { in alloc_cache_entry()
431 kfree(ce->path); in alloc_cache_entry()
468 static int add_cache_entry(const char *path, unsigned int hash, in add_cache_entry() argument
473 ce = alloc_cache_entry(path, refs, numrefs); in add_cache_entry()
495 static struct cache_entry *__lookup_cache_entry(const char *path) in __lookup_cache_entry() argument
501 h = cache_entry_hash(path, strlen(path)); in __lookup_cache_entry()
504 if (!strcasecmp(path, ce->path)) { in __lookup_cache_entry()
524 static struct cache_entry *lookup_cache_entry(const char *path, unsigned int *hash) in lookup_cache_entry() argument
533 npath = kstrndup(path, strlen(path), GFP_KERNEL); in lookup_cache_entry()
543 h = cache_entry_hash(path, strlen(path)); in lookup_cache_entry()
544 ce = __lookup_cache_entry(path); in lookup_cache_entry()
629 static int __update_cache_entry(const char *path, in __update_cache_entry() argument
637 ce = lookup_cache_entry(path, NULL); in __update_cache_entry()
660 const char *path, struct dfs_info3_param **refs, in get_dfs_referral() argument
663 cifs_dbg(FYI, "%s: get an DFS referral for %s\n", __func__, path); in get_dfs_referral()
673 return ses->server->ops->get_dfs_refer(xid, ses, path, refs, numrefs, in get_dfs_referral()
678 static int update_cache_entry(const char *path, in update_cache_entry() argument
686 rc = __update_cache_entry(path, refs, numrefs); in update_cache_entry()
703 const char *path, bool noreq) in __dfs_cache_find() argument
712 cifs_dbg(FYI, "%s: search path: %s\n", __func__, path); in __dfs_cache_find()
716 ce = lookup_cache_entry(path, &hash); in __dfs_cache_find()
745 rc = get_dfs_referral(xid, ses, nls_codepage, remap, path, in __dfs_cache_find()
753 rc = update_cache_entry(path, refs, numrefs); in __dfs_cache_find()
765 rc = add_cache_entry(path, hash, refs, numrefs); in __dfs_cache_find()
779 static int setup_referral(const char *path, struct cache_entry *ce, in setup_referral() argument
788 ref->path_name = kstrndup(path, strlen(path), GFP_ATOMIC); in setup_referral()
879 const char *path, struct dfs_info3_param *ref, in dfs_cache_find() argument
886 rc = get_normalized_path(path, &npath); in dfs_cache_find()
904 rc = setup_referral(path, ce, ref, get_tgt_name(ce)); in dfs_cache_find()
913 free_normalized_path(path, npath); in dfs_cache_find()
933 int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref, in dfs_cache_noreq_find() argument
940 rc = get_normalized_path(path, &npath); in dfs_cache_noreq_find()
955 rc = setup_referral(path, ce, ref, get_tgt_name(ce)); in dfs_cache_noreq_find()
963 free_normalized_path(path, npath); in dfs_cache_noreq_find()
988 const char *path, in dfs_cache_update_tgthint() argument
996 rc = get_normalized_path(path, &npath); in dfs_cache_update_tgthint()
1031 free_normalized_path(path, npath); in dfs_cache_update_tgthint()
1050 int dfs_cache_noreq_update_tgthint(const char *path, in dfs_cache_noreq_update_tgthint() argument
1061 rc = get_normalized_path(path, &npath); in dfs_cache_noreq_update_tgthint()
1092 free_normalized_path(path, npath); in dfs_cache_noreq_update_tgthint()
1107 int dfs_cache_get_tgt_referral(const char *path, in dfs_cache_get_tgt_referral() argument
1118 rc = get_normalized_path(path, &npath); in dfs_cache_get_tgt_referral()
1134 rc = setup_referral(path, ce, ref, it->it_name); in dfs_cache_get_tgt_referral()
1138 free_normalized_path(path, npath); in dfs_cache_get_tgt_referral()
1334 int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, in dfs_cache_get_tgt_share() argument
1341 if (!it || !path || !share || !prefix || strlen(path) < it->it_path_consumed) in dfs_cache_get_tgt_share()
1367 p = path + it->it_path_consumed; in dfs_cache_get_tgt_share()
1373 plen2 = path + strlen(path) - p; in dfs_cache_get_tgt_share()
1415 static bool is_dfs_link(const char *path) in is_dfs_link() argument
1419 s = strchr(path + 1, '\\'); in is_dfs_link()
1425 static char *get_dfs_root(const char *path) in get_dfs_root() argument
1429 s = strchr(path + 1, '\\'); in get_dfs_root()
1437 npath = kstrndup(path, s - path, GFP_KERNEL); in get_dfs_root()
1471 const char *path) in find_root_ses() argument
1482 rpath = get_dfs_root(path); in find_root_ses()
1495 rc = setup_referral(path, ce, &ref, get_tgt_name(ce)); in find_root_ses()
1543 char *path, *npath; in refresh_tcon() local
1551 path = tcon->dfs_path + 1; in refresh_tcon()
1553 rc = get_normalized_path(path, &npath); in refresh_tcon()
1597 free_normalized_path(path, npath); in refresh_tcon()