X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmachine-image.c;h=c6d2850ad2dcf9d901f3dce0f5ffe4d6b1a1e4f3;hb=587fec427c80b6c34dcf1d7570f891fcb652a7c5;hp=c734f148aec6d5f96d0742a8242052f680946955;hpb=2eec67acbb00593e414549a7e5b35eb7dd776b1b;p=elogind.git diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index c734f148a..c6d2850ad 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;