Lines Matching refs:path
36 static android::status_t GetMountPath(uid_t uid, const std::string& name, std::string* path) { in GetMountPath() argument
47 *path = StringPrintf("/mnt/appfuse/%d_%s", uid, name.c_str()); in GetMountPath()
51 static android::status_t Mount(int device_fd, const std::string& path) { in Mount() argument
63 TEMP_FAILURE_RETRY(mount("/dev/fuse", path.c_str(), "fuse", in Mount()
66 PLOG(ERROR) << "Failed to mount " << path; in Mount()
73 static android::status_t RunCommand(const std::string& command, uid_t uid, const std::string& path, in RunCommand() argument
76 LOG(DEBUG) << "Run app fuse command " << command << " for the path " << path << " and uid " in RunCommand()
81 return Mount(device_fd, path); in RunCommand()
85 if (umount2(path.c_str(), UMOUNT_NOFOLLOW | MNT_DETACH) != 0 && errno != EINVAL && in RunCommand()
90 if (rmdir(path.c_str()) != 0) { in RunCommand()
109 std::string path; in MountAppFuse() local
110 if (GetMountPath(uid, name, &path) != android::OK) { in MountAppFuse()
118 android::vold::ForceUnmount(path); in MountAppFuse()
121 const android::status_t result = android::vold::PrepareDir(path, 0700, 0, 0); in MountAppFuse()
123 PLOG(ERROR) << "Failed to prepare directory " << path; in MountAppFuse()
136 return RunCommand("mount", uid, path, device_fd->get()); in MountAppFuse()
143 std::string path; in UnmountAppFuse() local
144 if (GetMountPath(uid, name, &path) != android::OK) { in UnmountAppFuse()
149 return RunCommand("unmount", uid, path, -1 /* device_fd */); in UnmountAppFuse()
162 std::string path = StringPrintf("%s/%d", mountPoint.c_str(), fileId); in OpenAppFuseFile() local
163 return TEMP_FAILURE_RETRY(open(path.c_str(), flags)); in OpenAppFuseFile()