X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmachine-image.h;h=f041600fbfb6d1ea9257e000bc5c676b2dcc3251;hb=30ab6a0fc1bb950c4dcd90dcd3dfe00a810c7fc1;hp=e17e32f4a5ccad797c5312764384a09fba6cc646;hpb=086821244b5113f00a0ef993b78dc56aae2a8f6c;p=elogind.git diff --git a/src/shared/machine-image.h b/src/shared/machine-image.h index e17e32f4a..f041600fb 100644 --- a/src/shared/machine-image.h +++ b/src/shared/machine-image.h @@ -22,12 +22,13 @@ ***/ #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; @@ -40,6 +41,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); @@ -52,6 +60,16 @@ int image_find(const char *name, Image **ret); int image_discover(Hashmap *map); int image_remove(Image *i); +int image_rename(Image *i, const char *new_name); +int image_clone(Image *i, const char *new_name, bool read_only); +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 referenced_max);