| 891 | |
| 892 | |
| 893 | Try<Nothing> XfsDiskIsolatorProcess::scheduleProjectRoot( |
| 894 | prid_t projectId, |
| 895 | const string& rootDir) |
| 896 | { |
| 897 | Try<string> devname = xfs::getDeviceForPath(rootDir); |
| 898 | |
| 899 | if (devname.isError()) { |
| 900 | return Error(devname.error()); |
| 901 | } |
| 902 | |
| 903 | if (!scheduledProjects.contains(projectId)) { |
| 904 | scheduledProjects.put(projectId, ProjectRoots{devname.get(), {rootDir}}); |
| 905 | } else { |
| 906 | ProjectRoots& roots = scheduledProjects.at(projectId); |
| 907 | |
| 908 | if (roots.deviceName != devname.get()) { |
| 909 | return Error(strings::format( |
| 910 | "Conflicting device names '%s' and '%s' for project ID %s", |
| 911 | roots.deviceName, devname.get(), projectId).get()); |
| 912 | } |
| 913 | |
| 914 | roots.directories.insert(rootDir); |
| 915 | } |
| 916 | |
| 917 | return Nothing(); |
| 918 | } |
| 919 | |
| 920 | void XfsDiskIsolatorProcess::reclaimProjectIds() |
| 921 | { |