Lines Matching refs:path
40 static void fixProcPath(std::string& path) { in fixProcPath() argument
43 auto pos = std::search(path.begin(), path.end(), kPrefix.begin(), kPrefix.end()); in fixProcPath()
44 if (pos == path.end()) { in fixProcPath()
49 if (path.end() - pos < kPatternLength || !std::equal(kPrefix.begin(), kPrefix.end(), pos)) { in fixProcPath()
63 } while (pos != path.end()); in fixProcPath()
64 path.erase(dest, path.end()); in fixProcPath()
88 std::string_view path) const { in rootIndex()
89 auto it = rootByBindPoint.lower_bound(path); in rootIndex()
90 if (it != rootByBindPoint.end() && it->first == path) { in rootIndex()
95 if (path::startsWith(path, it->first) && path.size() > it->first.size()) { in rootIndex()
98 LOG(ERROR) << "[incfs] Root for path '" << path << "' #" << index in rootIndex()
108 std::string_view MountRegistry::Mounts::rootFor(std::string_view path) const { in rootFor()
109 auto [index, _] = rootIndex(path::normalize(path)); in rootFor()
113 return roots[index].path; in rootFor()
117 std::string_view path) const { in rootAndSubpathFor()
118 auto normalPath = path::normalize(path); in rootAndSubpathFor()
125 const auto pastBindSubdir = path::relativize(bindIt->first, normalPath); in rootAndSubpathFor()
127 return {root.path, path::join(bindSubdir, pastBindSubdir)}; in rootAndSubpathFor()
132 auto absolute = path::normalize(root); in addRoot()
134 roots.push_back({std::move(absolute), path::normalize(backingDir), {it}}); in addRoot()
138 auto absolute = path::normalize(root); in removeRoot()
165 auto srcAbsolute = path::normalize(src); in moveBind()
166 auto destAbsolute = path::normalize(dest); in moveBind()
177 if (roots[root].path == srcAbsolute) { in moveBind()
179 roots[root].path = destAbsolute; in moveBind()
195 auto whatAbsolute = path::normalize(what); in addBind()
203 auto whatSubpath = path::relativize(currentBind, whatAbsolute); in addBind()
205 auto realSubdir = path::join(subdir, whatSubpath); in addBind()
207 .insert_or_assign(path::normalize(where), in addBind()
214 auto absolute = path::normalize(what); in removeBind()
220 if (roots[root].path == absolute) { in removeBind()
243 std::string MountRegistry::rootFor(std::string_view path) { in rootFor() argument
245 return std::string(mMounts.rootFor(path)); in rootFor()
247 std::pair<std::string, std::string> MountRegistry::rootAndSubpathFor(std::string_view path) { in rootAndSubpathFor() argument
249 auto [root, subpath] = mMounts.rootAndSubpathFor(path); in rootAndSubpathFor()
347 mountPoint = path::normalize(mountPoint); in loadFrom()
387 root.path = std::move(mount.root); in loadFrom()