if (!liblxcfs_functional())
return -EIO;
- if (!fc || !cgroup_ops || pure_unified_layout(cgroup_ops))
+ if (!fc || !cgroup_ops)
return -EIO;
memset(sb, 0, sizeof(struct stat));
sb->st_atim = sb->st_mtim = sb->st_ctim = now;
sb->st_size = 0;
- if (strcmp(path, "/cgroup") == 0) {
+ if (pure_unified_layout(cgroup_ops) || strcmp(path, "/cgroup") == 0) {
sb->st_mode = S_IFDIR | 00755;
sb->st_nlink = 2;
return 0;
return 0;
}
+
get_cgdir_and_path(cgroup, &cgdir, &last);
if (!last) {
if (!liblxcfs_functional())
return -EIO;
- if (!fc || !cgroup_ops || pure_unified_layout(cgroup_ops))
+ if (!fc || !cgroup_ops)
return -EIO;
- if (strcmp(path, "/cgroup") == 0) {
+ if (pure_unified_layout(cgroup_ops) || strcmp(path, "/cgroup") == 0) {
cgroup = NULL;
controller = NULL;
} else {
if (!liblxcfs_functional())
return -EIO;
- if (!fc || !cgroup_ops || pure_unified_layout(cgroup_ops))
+ if (!fc || !cgroup_ops)
return -EIO;
+ if (pure_unified_layout(cgroup_ops)) {
+ ret = 0;
+ goto out;
+ }
+
if (DIR_FILLER(filler, buf, ".", NULL, 0) != 0 || DIR_FILLER(filler, buf, "..", NULL, 0) != 0)
return -EIO;