Lines Matching full:path

40 	const char *path;  member
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) in dfs_cache_canonical_path() argument
82 if (!path || strlen(path) < 3 || (*path != '\\' && *path != '/')) in dfs_cache_canonical_path()
86 tmp = (char *)cifs_strndup_to_utf16(path, strlen(path), &plen, cp, remap); in dfs_cache_canonical_path()
88 cifs_dbg(VFS, "%s: failed to convert path to utf16\n", __func__); in dfs_cache_canonical_path()
96 cifs_dbg(VFS, "%s: failed to convert path from utf16\n", __func__); in dfs_cache_canonical_path()
100 npath = kstrdup(path, GFP_KERNEL); in dfs_cache_canonical_path()
129 cifs_dbg(FYI, "%s: %s\n", __func__, ce->path); in flush_cache_ent()
131 kfree(ce->path); in flush_cache_ent()
173 …"cache entry: path=%s,type=%s,ttl=%d,etime=%ld,hdr_flags=0x%x,ref_flags=0x%x,interlink=%s,path_con… in dfscache_proc_show()
174 ce->path, ce->srvtype == DFS_TYPE_ROOT ? "root" : "link", in dfscache_proc_show()
240 …cifs_dbg(FYI, "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,hdr_flags=0x%x,ref_flags=0x%x,interli… in dump_ce()
241 ce->path, in dump_ce()
430 ce->path = refs[0].path_name; in alloc_cache_entry()
438 kfree(ce->path); in alloc_cache_entry()
533 static struct cache_entry *__lookup_cache_entry(const char *path, unsigned int hash, int len) in __lookup_cache_entry() argument
538 if (dfs_path_equal(ce->path, strlen(ce->path), path, len)) { in __lookup_cache_entry()
547 * Find a DFS cache entry in hash table and optionally check prefix path against normalized @path.
549 * Use whole path components in the match. Must be called with htable_rw_lock held.
555 static struct cache_entry *lookup_cache_entry(const char *path) in lookup_cache_entry() argument
559 const char *s = path, *e; in lookup_cache_entry()
568 rc = cache_entry_hash(path, strlen(path), &hash); in lookup_cache_entry()
571 return __lookup_cache_entry(path, hash, strlen(path)); in lookup_cache_entry()
574 * Handle paths that have more than two path components and are a complete prefix of the DFS in lookup_cache_entry()
575 * referral request path (@path). in lookup_cache_entry()
579 e = path + strlen(path) - 1; in lookup_cache_entry()
589 len = e + 1 - path; in lookup_cache_entry()
590 rc = cache_entry_hash(path, len, &hash); in lookup_cache_entry()
593 ce = __lookup_cache_entry(path, hash, len); in lookup_cache_entry()
644 static int get_dfs_referral(const unsigned int xid, struct cifs_ses *ses, const char *path, in get_dfs_referral() argument
658 cifs_dbg(FYI, "%s: ipc=%s referral=%s\n", __func__, ses->tcon_ipc->tree_name, path); in get_dfs_referral()
659 rc = ses->server->ops->get_dfs_refer(xid, ses, path, refs, numrefs, cache_cp, in get_dfs_referral()
683 const char *path, in cache_refresh_path() argument
691 cifs_dbg(FYI, "%s: search path: %s\n", __func__, path); in cache_refresh_path()
695 ce = lookup_cache_entry(path); in cache_refresh_path()
717 rc = get_dfs_referral(xid, ses, path, &refs, &numrefs); in cache_refresh_path()
727 ce = lookup_cache_entry(path); in cache_refresh_path()
754 static int setup_referral(const char *path, struct cache_entry *ce, in setup_referral() argument
763 ref->path_name = kstrdup(path, GFP_ATOMIC); in setup_referral()
836 * for @path and create a new entry.
839 * for @path and then update the respective cache entry.
846 * @remap: path character remapping type
847 * @path: path to lookup in DFS referral cache.
855 int remap, const char *path, struct dfs_info3_param *ref, in dfs_cache_find() argument
862 npath = dfs_cache_canonical_path(path, cp, remap); in dfs_cache_find()
873 rc = setup_referral(path, ce, ref, get_tgt_name(ce)); in dfs_cache_find()
891 * expired, nor create a new cache entry if @path hasn't been found. It heavily
894 * @path: canonical DFS path to lookup in the DFS referral cache.
902 int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref, in dfs_cache_noreq_find() argument
908 cifs_dbg(FYI, "%s: path: %s\n", __func__, path); in dfs_cache_noreq_find()
912 ce = lookup_cache_entry(path); in dfs_cache_noreq_find()
919 rc = setup_referral(path, ce, ref, get_tgt_name(ce)); in dfs_cache_noreq_find()
935 * expired, nor create a new cache entry if @path hasn't been found. It heavily
938 * @path: canonical DFS path to lookup in DFS referral cache.
944 void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it) in dfs_cache_noreq_update_tgthint() argument
949 if (!path || !it) in dfs_cache_noreq_update_tgthint()
952 cifs_dbg(FYI, "%s: path: %s\n", __func__, path); in dfs_cache_noreq_update_tgthint()
956 ce = lookup_cache_entry(path); in dfs_cache_noreq_update_tgthint()
982 * @path: canonical DFS path to lookup in DFS referral cache.
988 int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it, in dfs_cache_get_tgt_referral() argument
997 cifs_dbg(FYI, "%s: path: %s\n", __func__, path); in dfs_cache_get_tgt_referral()
1001 ce = lookup_cache_entry(path); in dfs_cache_get_tgt_referral()
1009 rc = setup_referral(path, ce, ref, it->it_name); in dfs_cache_get_tgt_referral()
1016 /* Extract share from DFS target and return a pointer to prefix path or NULL */
1043 * @path: DFS full path
1046 * @prefix: prefix path.
1050 int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it, char **share, in dfs_cache_get_tgt_share() argument
1060 if (!it || !path || !share || !prefix || strlen(path) < it->it_path_consumed) in dfs_cache_get_tgt_share()
1071 /* point to prefix in DFS referral path */ in dfs_cache_get_tgt_share()
1072 dfsref_ppath = path + it->it_path_consumed; in dfs_cache_get_tgt_share()
1078 /* merge prefix paths from DFS referral path and target node */ in dfs_cache_get_tgt_share()
1183 const char *path; in refresh_ses_referral() local
1188 path = dfs_ses_refpath(ses); in refresh_ses_referral()
1189 if (IS_ERR(path)) { in refresh_ses_referral()
1190 rc = PTR_ERR(path); in refresh_ses_referral()
1201 ce = cache_refresh_path(xid, ses, path, false); in refresh_ses_referral()
1212 const char *path, in __refresh_tcon_referral() argument
1235 ce = lookup_cache_entry(path); in __refresh_tcon_referral()
1259 const char *path; in refresh_tcon_referral() local
1267 path = dfs_ses_refpath(ses); in refresh_tcon_referral()
1268 if (IS_ERR(path)) { in refresh_tcon_referral()
1269 rc = PTR_ERR(path); in refresh_tcon_referral()
1274 ce = lookup_cache_entry(path); in refresh_tcon_referral()
1289 rc = get_dfs_referral(xid, ses, path, &refs, &numrefs); in refresh_tcon_referral()
1291 rc = __refresh_tcon_referral(tcon, path, refs, in refresh_tcon_referral()
1333 * Force the use of prefix path to support failover on DFS paths that resolve to targets in dfs_cache_remount_fs()