diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
commit | 8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch) | |
tree | 1fdda006866bca20d41cb206767ea5241e36852f /libblkid/src/superblocks/superblocks.h | |
parent | Adding debian version 2.39.3-11. (diff) | |
download | util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip |
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libblkid/src/superblocks/superblocks.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libblkid/src/superblocks/superblocks.h b/libblkid/src/superblocks/superblocks.h index a990058..dc669e0 100644 --- a/libblkid/src/superblocks/superblocks.h +++ b/libblkid/src/superblocks/superblocks.h @@ -9,7 +9,7 @@ #include "blkidP.h" -enum BLKID_ENDIANNESS { +enum blkid_endianness { BLKID_ENDIANNESS_LITTLE, BLKID_ENDIANNESS_BIG, }; @@ -128,9 +128,21 @@ int blkid_probe_set_block_size(blkid_probe pr, unsigned block_size); int blkid_probe_set_fssize(blkid_probe pr, uint64_t size); int blkid_probe_set_fslastblock(blkid_probe pr, uint64_t lastblock); int blkid_probe_set_fsblocksize(blkid_probe pr, uint32_t block_size); -int blkid_probe_set_fsendianness(blkid_probe pr, enum BLKID_ENDIANNESS endianness); +int blkid_probe_set_fsendianness(blkid_probe pr, enum blkid_endianness endianness); extern int blkid_probe_is_bitlocker(blkid_probe pr); extern int blkid_probe_is_ntfs(blkid_probe pr); +/* + * utility functions + */ +static inline int blkid32_to_cpu(enum blkid_endianness e, uint32_t i) +{ + if (e == BLKID_ENDIANNESS_LITTLE) + return le32_to_cpu(i); + else if (e == BLKID_ENDIANNESS_BIG) + return be32_to_cpu(i); + abort(); +} + #endif /* _BLKID_SUPERBLOCKS_H */ |