chiark / gitweb /
util: loop_write - accept 0-length message
[elogind.git] / src / shared / machine-image.h
index 4f41b4f307e8d94599f8cc32a622d12e9a2af953..f041600fbfb6d1ea9257e000bc5c676b2dcc3251 100644 (file)
 ***/
 
 #include "time-util.h"
+#include "lockfile-util.h"
 #include "hashmap.h"
 
 typedef enum ImageType {
         IMAGE_DIRECTORY,
         IMAGE_SUBVOLUME,
-        IMAGE_GPT,
+        IMAGE_RAW,
         _IMAGE_TYPE_MAX,
         _IMAGE_TYPE_INVALID = -1
 } ImageType;
@@ -41,10 +42,12 @@ typedef struct Image {
         usec_t crtime;
         usec_t mtime;
 
-        uint64_t size;
-        uint64_t size_exclusive;
+        uint64_t usage;
+        uint64_t usage_exclusive;
         uint64_t limit;
         uint64_t limit_exclusive;
+
+        void *userdata;
 } Image;
 
 Image *image_unref(Image *i);
@@ -68,3 +71,5 @@ bool image_name_is_valid(const char *s) _pure_;
 
 int image_path_lock(const char *path, int operation, LockFile *global, LockFile *local);
 int image_name_lock(const char *name, int operation, LockFile *ret);
+
+int image_set_limit(Image *i, uint64_t referenced_max);