chiark / gitweb /
machined,machinectl: add calls for changing container/VM quotas
[elogind.git] / src / shared / machine-image.c
index c734f148aec6d5f96d0742a8242052f680946955..c6d2850ad2dcf9d901f3dce0f5ffe4d6b1a1e4f3 100644 (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;