Lines Matching refs:path

40 	const char *path;
68 * dfs_cache_canonical_path - get a canonical DFS path
70 * @path: DFS path
74 * Return canonical path if success, otherwise error.
76 char *dfs_cache_canonical_path(const char *path, const struct nls_table *cp, int remap)
82 if (!path || strlen(path) < 3 || (*path != '\\' && *path != '/'))
86 tmp = (char *)cifs_strndup_to_utf16(path, strlen(path), &plen, cp, remap);
88 cifs_dbg(VFS, "%s: failed to convert path to utf16\n", __func__);
96 cifs_dbg(VFS, "%s: failed to convert path from utf16\n", __func__);
100 npath = kstrdup(path, GFP_KERNEL);
130 kfree(ce->path);
172 "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,hdr_flags=0x%x,ref_flags=0x%x,interlink=%s,path_consumed=%d,expired=%s\n",
173 ce->path, ce->srvtype == DFS_TYPE_ROOT ? "root" : "link",
239 cifs_dbg(FYI, "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,hdr_flags=0x%x,ref_flags=0x%x,interlink=%s,path_consumed=%d,expired=%s\n",
240 ce->path,
429 ce->path = refs[0].path_name;
437 kfree(ce->path);
535 static struct cache_entry *__lookup_cache_entry(const char *path, unsigned int hash, int len)
540 if (dfs_path_equal(ce->path, strlen(ce->path), path, len)) {
549 * Find a DFS cache entry in hash table and optionally check prefix path against normalized @path.
551 * Use whole path components in the match. Must be called with htable_rw_lock held.
557 static struct cache_entry *lookup_cache_entry(const char *path)
561 const char *s = path, *e;
570 rc = cache_entry_hash(path, strlen(path), &hash);
573 return __lookup_cache_entry(path, hash, strlen(path));
576 * Handle paths that have more than two path components and are a complete prefix of the DFS
577 * referral request path (@path).
581 e = path + strlen(path) - 1;
591 len = e + 1 - path;
592 rc = cache_entry_hash(path, len, &hash);
595 ce = __lookup_cache_entry(path, hash, len);
646 static int get_dfs_referral(const unsigned int xid, struct cifs_ses *ses, const char *path,
660 cifs_dbg(FYI, "%s: ipc=%s referral=%s\n", __func__, ses->tcon_ipc->tree_name, path);
661 rc = ses->server->ops->get_dfs_refer(xid, ses, path, refs, numrefs, cache_cp,
685 const char *path,
693 cifs_dbg(FYI, "%s: search path: %s\n", __func__, path);
697 ce = lookup_cache_entry(path);
719 rc = get_dfs_referral(xid, ses, path, &refs, &numrefs);
729 ce = lookup_cache_entry(path);
756 static int setup_referral(const char *path, struct cache_entry *ce,
765 ref->path_name = kstrdup(path, GFP_ATOMIC);
838 * for @path and create a new entry.
841 * for @path and then update the respective cache entry.
848 * @remap: path character remapping type
849 * @path: path to lookup in DFS referral cache.
857 int remap, const char *path, struct dfs_info3_param *ref,
864 npath = dfs_cache_canonical_path(path, cp, remap);
875 rc = setup_referral(path, ce, ref, get_tgt_name(ce));
893 * expired, nor create a new cache entry if @path hasn't been found. It heavily
896 * @path: canonical DFS path to lookup in the DFS referral cache.
904 int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref,
910 cifs_dbg(FYI, "%s: path: %s\n", __func__, path);
914 ce = lookup_cache_entry(path);
921 rc = setup_referral(path, ce, ref, get_tgt_name(ce));
937 * expired, nor create a new cache entry if @path hasn't been found. It heavily
940 * @path: canonical DFS path to lookup in DFS referral cache.
946 void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it)
951 if (!path || !it)
954 cifs_dbg(FYI, "%s: path: %s\n", __func__, path);
958 ce = lookup_cache_entry(path);
984 * @path: canonical DFS path to lookup in DFS referral cache.
990 int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it,
999 cifs_dbg(FYI, "%s: path: %s\n", __func__, path);
1003 ce = lookup_cache_entry(path);
1011 rc = setup_referral(path, ce, ref, it->it_name);
1018 /* Extract share from DFS target and return a pointer to prefix path or NULL */
1045 * @path: DFS full path
1048 * @prefix: prefix path.
1052 int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, char **share,
1062 if (!it || !path || !share || !prefix || strlen(path) < it->it_path_consumed)
1073 /* point to prefix in DFS referral path */
1074 dfsref_ppath = path + it->it_path_consumed;
1080 /* merge prefix paths from DFS referral path and target node */
1136 const char *path,
1149 dfs_cache_noreq_update_tgthint(path, nit);
1176 static int __refresh_tcon(const char *path, struct cifs_ses *ses, bool force_refresh)
1189 ce = lookup_cache_entry(path);
1209 ce = cache_refresh_path(xid, ses, path, true);
1214 mark_for_reconnect_if_needed(server, path, &old_tl, &new_tl);
1269 * Force the use of prefix path to support failover on DFS paths that resolve to targets