X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmachine-image.h;h=df2394991f1b9bfc79ef0fb8c9fc9b718fd3a498;hb=587fec427c80b6c34dcf1d7570f891fcb652a7c5;hp=9e0f6aedbadb48ba4dc5054fd2488ac3552f17db;hpb=ebd93cb684806ac0f352139e69ac8f53eb49f5e4;p=elogind.git diff --git a/src/shared/machine-image.h b/src/shared/machine-image.h index 9e0f6aedb..df2394991 100644 --- a/src/shared/machine-image.h +++ b/src/shared/machine-image.h @@ -27,7 +27,7 @@ typedef enum ImageType { IMAGE_DIRECTORY, IMAGE_SUBVOLUME, - IMAGE_GPT, + IMAGE_RAW, _IMAGE_TYPE_MAX, _IMAGE_TYPE_INVALID = -1 } ImageType; @@ -40,6 +40,13 @@ typedef struct Image { usec_t crtime; usec_t mtime; + + uint64_t usage; + uint64_t usage_exclusive; + uint64_t limit; + uint64_t limit_exclusive; + + void *userdata; } Image; Image *image_unref(Image *i); @@ -58,3 +65,10 @@ int image_read_only(Image *i, bool b); const char* image_type_to_string(ImageType t) _const_; ImageType image_type_from_string(const char *s) _pure_; + +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 referred_max);