diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-10-29 09:59:35 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-11-19 00:05:53 +0100 |
commit | 5813fca61fb492b484e3f898680f1c69bf760caa (patch) | |
tree | 99f77efe1df66f8589c2eff2a24c0e2d2503d5b8 /src/home | |
parent | test: make the diff regex BRE-compatible (diff) | |
download | systemd-5813fca61fb492b484e3f898680f1c69bf760caa.tar.xz systemd-5813fca61fb492b484e3f898680f1c69bf760caa.zip |
homework: make destroying of HomeSetup optional when resizing
This will be useful when we want to issue a resize operation right when
activating, where the HomeSetup object should be destroyed only after
both activation is done.
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homework-luks.c | 8 | ||||
-rw-r--r-- | src/home/homework.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 294c052720..f7015529e7 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -3240,9 +3240,11 @@ int home_resize_luks( if (r < 0) return r; - r = home_setup_done(setup); - if (r < 0) - return r; + if (!FLAGS_SET(flags, HOME_SETUP_RESIZE_DONT_UNDO)) { + r = home_setup_done(setup); + if (r < 0) + return r; + } log_info("Everything completed."); diff --git a/src/home/homework.h b/src/home/homework.h index 55c2f5b2df..be77764d8e 100644 --- a/src/home/homework.h +++ b/src/home/homework.h @@ -63,6 +63,7 @@ typedef enum HomeSetupFlags { HOME_SETUP_RESIZE_MINIMIZE = 1 << 3, /* Shrink to minimal size */ HOME_SETUP_RESIZE_DONT_GROW = 1 << 4, /* If the resize would grow, gracefully terminate operation */ HOME_SETUP_RESIZE_DONT_SHRINK = 1 << 5, /* If the resize would shrink, gracefully terminate operation */ + HOME_SETUP_RESIZE_DONT_UNDO = 1 << 6, /* Leave loopback/DM device context open after successful operation */ } HomeSetupFlags; int home_setup_done(HomeSetup *setup); |