Home | History | Annotate | Download | only in vold

Lines Matching full:path

46 bool secdiscard_path(const std::string &path);
47 std::unique_ptr<struct fiemap> path_fiemap(const std::string &path, uint32_t extent_count);
48 bool check_fiemap(const struct fiemap &fiemap, const std::string &path);
50 std::string block_device_for_path(const std::string &path);
85 if (argv[j][0] != '/') return false; // Must be absolute path
97 fprintf(stderr, "Usage: %s [--no-unlink] -- <absolute path> ...\n", progname);
100 // BLKSECDISCARD all content in "path", if it's small enough.
101 bool secdiscard_path(const std::string &path) {
102 auto fiemap = path_fiemap(path, max_extents);
103 if (!fiemap || !check_fiemap(*fiemap, path)) {
106 auto block_device = block_device_for_path(path);
120 PLOG(ERROR) << "Unable to BLKSECDISCARD " << path;
129 std::unique_ptr<struct fiemap> path_fiemap(const std::string &path, uint32_t extent_count)
131 AutoCloseFD fd(path);
134 PLOG(DEBUG) << "Unable to open " << path;
136 PLOG(ERROR) << "Unable to open " << path;
142 PLOG(ERROR) << "Unable to FIEMAP " << path;
148 << " in " << path;
155 bool check_fiemap(const struct fiemap &fiemap, const std::string &path) {
158 LOG(ERROR) << "Extent " << mapped -1 << " was not the last in " << path;
164 LOG(ERROR) << "Extent " << i << " has unexpected flags " << flags << ": " << path;
184 // Given a file path, look for the corresponding block device in /proc/mount
185 std::string block_device_for_path(const std::string &path)
198 path.size() > l &&
199 path[l] == '/' &&
200 path.compare(0, l, mnt->mnt_dir) == 0) {
206 LOG(ERROR) <<"Didn't find a mountpoint to match path " << path;
209 LOG(DEBUG) << "For path " << path << " block device is " << result;