From 8bec643c8f8374b6608c7c3dadc145937bd80b96 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 29 Oct 2021 09:45:17 +0200 Subject: user-record: add auto-resize property --- src/shared/user-record.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/shared/user-record.h') diff --git a/src/shared/user-record.h b/src/shared/user-record.h index 22a6bb28f4..c5424eef82 100644 --- a/src/shared/user-record.h +++ b/src/shared/user-record.h @@ -213,6 +213,14 @@ typedef struct RecoveryKey { char *hashed_password; } RecoveryKey; +typedef enum AutoResizeMode { + AUTO_RESIZE_OFF, /* no automatic grow/shrink */ + AUTO_RESIZE_GROW, /* grow at login */ + AUTO_RESIZE_SHRINK_AND_GROW, /* shrink at logout + grow at login */ + _AUTO_RESIZE_MODE_MAX, + _AUTO_RESIZE_MODE_INVALID = -EINVAL, +} AutoResizeMode; + typedef struct UserRecord { /* The following three fields are not part of the JSON record */ unsigned n_ref; @@ -249,6 +257,7 @@ typedef struct UserRecord { uint64_t disk_size_relative; /* Disk size, relative to the free bytes of the medium, normalized to UINT32_MAX = 100% */ char *skeleton_directory; mode_t access_mode; + AutoResizeMode auto_resize_mode; uint64_t tasks_max; uint64_t memory_high; @@ -387,6 +396,7 @@ usec_t user_record_ratelimit_interval_usec(UserRecord *h); uint64_t user_record_ratelimit_burst(UserRecord *h); bool user_record_can_authenticate(UserRecord *h); bool user_record_drop_caches(UserRecord *h); +AutoResizeMode user_record_auto_resize_mode(UserRecord *h); int user_record_build_image_path(UserStorage storage, const char *user_name_and_realm, char **ret); @@ -417,3 +427,6 @@ UserStorage user_storage_from_string(const char *s) _pure_; const char* user_disposition_to_string(UserDisposition t) _const_; UserDisposition user_disposition_from_string(const char *s) _pure_; + +const char* auto_resize_mode_to_string(AutoResizeMode m) _const_; +AutoResizeMode auto_resize_mode_from_string(const char *s) _pure_; -- cgit v1.2.1