diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-11 22:46:39 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-18 07:56:32 +0900 |
commit | 1e63dc4f1cbec8a2d2bc053b49db23fe9d47a524 (patch) | |
tree | 9d56cdd7ff9fbaae288adfb756dabc83bfbebe74 /src/shared/dissect-image.h | |
parent | 36d5eb0bffc3cc7b8e4be1e41ee3cbd4ddd8c870 (diff) | |
download | systemd-1e63dc4f1cbec8a2d2bc053b49db23fe9d47a524.tar.gz |
dissect-image: take a reference of LoopDevice into DissectedImage
To make LoopDevice object freed after DissectedImage is freed.
At least currently, this should not change anything. Preparation for
later commits.
Diffstat (limited to 'src/shared/dissect-image.h')
-rw-r--r-- | src/shared/dissect-image.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h index 7308798493..efddea80c7 100644 --- a/src/shared/dissect-image.h +++ b/src/shared/dissect-image.h @@ -210,6 +210,7 @@ struct DissectedImage { bool verity_sig_ready:1; /* verity signature logic, fully specified and usable */ bool single_file_system:1; /* MBR/GPT or single file system */ + LoopDevice *loop; DissectedPartition partitions[_PARTITION_DESIGNATOR_MAX]; DecryptedImage *decrypted_image; @@ -262,11 +263,8 @@ int dissect_image( const MountOptions *mount_options, DissectImageFlags flags, DissectedImage **ret); -static inline int dissect_loop_device(const LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, DissectImageFlags flags, DissectedImage **ret) { - assert(loop); - return dissect_image(loop->fd, loop->node, loop->backing_file ?: loop->node, verity, mount_options, flags, ret); -} -int dissect_loop_device_and_warn(const LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, DissectImageFlags flags, DissectedImage **ret); +int dissect_loop_device(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, DissectImageFlags flags, DissectedImage **ret); +int dissect_loop_device_and_warn(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, DissectImageFlags flags, DissectedImage **ret); DissectedImage* dissected_image_unref(DissectedImage *m); DEFINE_TRIVIAL_CLEANUP_FUNC(DissectedImage*, dissected_image_unref); |