diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-02-24 23:50:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-02-25 22:06:54 +0100 |
commit | d6ce17c7f02ed3facdb45f65f546e587c2f00950 (patch) | |
tree | 844e595be12176a1e29163fa64f0af0b86d953bd /src/shared/machine-image.c | |
parent | 950c07d421c04e5aae99973479f4f13131fb45e1 (diff) |
machined,machinectl: add calls for changing container/VM quotas
Diffstat (limited to 'src/shared/machine-image.c')
-rw-r--r-- | src/shared/machine-image.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index c734f148ae..c6d2850ad2 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -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; |