Lines Matching defs:path
38 const char *path;
82 static int get_normalized_path(const char *path, char **npath)
84 if (!path || strlen(path) < 3 || (*path != '\\' && *path != '/'))
87 if (*path == '\\') {
88 *npath = (char *)path;
90 *npath = kstrndup(path, strlen(path), GFP_KERNEL);
98 static inline void free_normalized_path(const char *path, char *npath)
100 if (path != npath)
126 kfree(ce->path);
168 "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,"
170 ce->path,
238 cifs_dbg(FYI, "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,interlink=%s,path_consumed=%d,expired=%s\n",
239 ce->path,
321 /* Check whether second path component of @path is SYSVOL or NETLOGON */
322 static inline bool is_sysvol_or_netlogon(const char *path)
325 char sep = path[0];
327 s = strchr(path + 1, sep) + 1;
410 static struct cache_entry *alloc_cache_entry(const char *path,
421 ce->path = kstrndup(path, strlen(path), GFP_KERNEL);
422 if (!ce->path) {
431 kfree(ce->path);
468 static int add_cache_entry(const char *path, unsigned int hash,
473 ce = alloc_cache_entry(path, refs, numrefs);
495 static struct cache_entry *__lookup_cache_entry(const char *path)
501 h = cache_entry_hash(path, strlen(path));
504 if (!strcasecmp(path, ce->path)) {
517 * Find a DFS cache entry in hash table and optionally check prefix path against
518 * @path.
519 * Use whole path components in the match.
524 static struct cache_entry *lookup_cache_entry(const char *path, unsigned int *hash)
533 npath = kstrndup(path, strlen(path), GFP_KERNEL);
543 h = cache_entry_hash(path, strlen(path));
544 ce = __lookup_cache_entry(path);
548 * Handle paths that have more than two path components and are a complete prefix of the DFS
549 * referral request path (@path).
629 static int __update_cache_entry(const char *path,
637 ce = lookup_cache_entry(path, NULL);
660 const char *path, struct dfs_info3_param **refs,
663 cifs_dbg(FYI, "%s: get an DFS referral for %s\n", __func__, path);
673 return ses->server->ops->get_dfs_refer(xid, ses, path, refs, numrefs,
678 static int update_cache_entry(const char *path,
686 rc = __update_cache_entry(path, refs, numrefs);
703 const char *path, bool noreq)
712 cifs_dbg(FYI, "%s: search path: %s\n", __func__, path);
716 ce = lookup_cache_entry(path, &hash);
745 rc = get_dfs_referral(xid, ses, nls_codepage, remap, path,
753 rc = update_cache_entry(path, refs, numrefs);
765 rc = add_cache_entry(path, hash, refs, numrefs);
779 static int setup_referral(const char *path, struct cache_entry *ce,
788 ref->path_name = kstrndup(path, strlen(path), GFP_ATOMIC);
859 * for @path and create a new entry.
862 * for @path and then update the respective cache entry.
869 * @remap: path character remapping type
870 * @path: path to lookup in DFS referral cache.
879 const char *path, struct dfs_info3_param *ref,
886 rc = get_normalized_path(path, &npath);
904 rc = setup_referral(path, ce, ref, get_tgt_name(ce));
913 free_normalized_path(path, npath);
922 * expired, nor create a new cache entry if @path hasn't been found. It heavily
925 * @path: path to lookup in the DFS referral cache.
933 int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref,
940 rc = get_normalized_path(path, &npath);
944 cifs_dbg(FYI, "%s: path: %s\n", __func__, npath);
955 rc = setup_referral(path, ce, ref, get_tgt_name(ce));
963 free_normalized_path(path, npath);
971 * If it doesn't find the cache entry, then it will get a DFS referral for @path
975 * for @path and then update the respective cache entry.
981 * @path: path to lookup in DFS referral cache.
988 const char *path,
996 rc = get_normalized_path(path, &npath);
1000 cifs_dbg(FYI, "%s: update target hint - path: %s\n", __func__, npath);
1031 free_normalized_path(path, npath);
1041 * expired, nor create a new cache entry if @path hasn't been found. It heavily
1044 * @path: path to lookup in DFS referral cache.
1050 int dfs_cache_noreq_update_tgthint(const char *path,
1061 rc = get_normalized_path(path, &npath);
1065 cifs_dbg(FYI, "%s: path: %s\n", __func__, npath);
1092 free_normalized_path(path, npath);
1101 * @path: path to lookup in DFS referral cache.
1107 int dfs_cache_get_tgt_referral(const char *path,
1118 rc = get_normalized_path(path, &npath);
1122 cifs_dbg(FYI, "%s: path: %s\n", __func__, npath);
1134 rc = setup_referral(path, ce, ref, it->it_name);
1138 free_normalized_path(path, npath);
1207 * @fullpath: origin full path.
1327 * @path: DFS full path
1330 * @prefix: prefix path.
1334 int dfs_cache_get_tgt_share(char *path, const struct dfs_cache_tgt_iterator *it,
1341 if (!it || !path || !share || !prefix || strlen(path) < it->it_path_consumed)
1366 /* point to prefix in DFS path */
1367 p = path + it->it_path_consumed;
1371 /* merge prefix paths from DFS path and target node */
1373 plen2 = path + strlen(path) - p;
1415 static bool is_dfs_link(const char *path)
1419 s = strchr(path + 1, '\\');
1425 static char *get_dfs_root(const char *path)
1429 s = strchr(path + 1, '\\');
1437 npath = kstrndup(path, s - path, GFP_KERNEL);
1468 /* Find root SMB session out of a DFS link path */
1471 const char *path)
1482 rpath = get_dfs_root(path);
1495 rc = setup_referral(path, ce, &ref, get_tgt_name(ce));
1543 char *path, *npath;
1551 path = tcon->dfs_path + 1;
1553 rc = get_normalized_path(path, &npath);
1597 free_normalized_path(path, npath);