MCPcopy Create free account
hub / github.com/apache/mesos / getDeviceForPath

Function getDeviceForPath

src/slave/containerizer/mesos/isolators/xfs/utils.cpp:110–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109
110Try<string> getDeviceForPath(const string& path)
111{
112 struct stat statbuf;
113
114 if (::lstat(path.c_str(), &statbuf) == -1) {
115 return ErrnoError("Unable to access '" + path + "'");
116 }
117
118 if (S_ISBLK(statbuf.st_mode)) {
119 return path;
120 }
121
122 char* name = blkid_devno_to_devname(statbuf.st_dev);
123 if (name == nullptr) {
124 return ErrnoError("Unable to get device for '" + path + "'");
125 }
126
127 string devname(name);
128 free(name);
129
130 return devname;
131}
132
133
134namespace internal {

Callers 5

TEST_FFunction · 0.85
scheduleProjectRootMethod · 0.85
setProjectQuotaFunction · 0.85
getProjectQuotaFunction · 0.85
isQuotaEnabledFunction · 0.85

Calls 2

ErrnoErrorClass · 0.85
S_ISBLKFunction · 0.85

Tested by 1

TEST_FFunction · 0.68