machined,machinectl: add calls for changing container/VM quotas

This commit is contained in:
Lennart Poettering
2015-02-25 22:06:54 +01:00
parent 950c07d421
commit d6ce17c7f0
10 changed files with 226 additions and 6 deletions
+13
View File
@@ -613,6 +613,19 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
return 0;
}
int image_set_limit(Image *i, uint64_t referred_max) {
assert(i);
if (path_equal(i->path, "/") ||
path_startswith(i->path, "/usr"))
return -EROFS;
if (i->type != IMAGE_SUBVOLUME)
return -ENOTSUP;
return btrfs_quota_limit(i->path, referred_max);
}
int image_name_lock(const char *name, int operation, LockFile *ret) {
const char *p;