summaryrefslogtreecommitdiff
path: root/src/shared/user-record.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-10-29 09:45:17 +0200
committerLennart Poettering <lennart@poettering.net>2021-11-23 08:04:10 +0100
commit8bec643c8f8374b6608c7c3dadc145937bd80b96 (patch)
tree7d2672473233d1fffc5742d20504d9b6dd2d74d4 /src/shared/user-record.h
parentf2ec9d2955da1e8631ad6c53e7076f963463f149 (diff)
downloadsystemd-8bec643c8f8374b6608c7c3dadc145937bd80b96.tar.gz
user-record: add auto-resize property
Diffstat (limited to 'src/shared/user-record.h')
-rw-r--r--src/shared/user-record.h13
1 files changed, 13 insertions, 0 deletions
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_;