mirror of
https://github.com/systemd/systemd.git
synced 2025-03-23 10:50:16 +03:00
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.
This commit is contained in:
parent
1285252823
commit
5813fca61f
@ -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.");
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user