diff options
author | Sami Kerola | 2019-05-23 22:06:23 +0200 |
---|---|---|
committer | Karel Zak | 2019-05-27 11:58:13 +0200 |
commit | ebd13d3fc53189ab620da51eae2dfc6b19db786c (patch) | |
tree | c286f9cd0b17b9fdca861aa41e5502e5e0cfc40f /libblkid | |
parent | login: retire use of __FUNCTION__ macro (diff) | |
download | kernel-qcow2-util-linux-ebd13d3fc53189ab620da51eae2dfc6b19db786c.tar.gz kernel-qcow2-util-linux-ebd13d3fc53189ab620da51eae2dfc6b19db786c.tar.xz kernel-qcow2-util-linux-ebd13d3fc53189ab620da51eae2dfc6b19db786c.zip |
libblkid: remove unneeded fields from struct bcache_super_block
This started as fix to following warning.
libblkid/src/superblocks/bcache.c:33:3: warning: ISO C99 doesn’t
support unnamed structs/unions [-Wc99-c11-compat]
But when sent to review Karel told out rather than getting rid of warnings
lets get rid of everything unnecessary.
[kzak@redhat.com: - use original struct member names rather than 'padN']
Reference: https://github.com/karelzak/util-linux/pull/802
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/superblocks/bcache.c | 53 |
1 files changed, 7 insertions, 46 deletions
diff --git a/libblkid/src/superblocks/bcache.c b/libblkid/src/superblocks/bcache.c index 28eb24d5f..aa2dc04ec 100644 --- a/libblkid/src/superblocks/bcache.c +++ b/libblkid/src/superblocks/bcache.c @@ -19,55 +19,16 @@ #define node(i, j) ((i)->d + (j)) #define end(i) node(i, le16_to_cpu((i)->keys)) +/* + * The bcache_super_block is heavily simplified version of struct cache_sb in kernel. + * https://github.com/torvalds/linux/blob/master/include/uapi/linux/bcache.h + */ struct bcache_super_block { uint64_t csum; - uint64_t offset; /* sector where this sb was written */ + uint64_t offset; /* where this super block was written */ uint64_t version; - - uint8_t magic[16]; - - uint8_t uuid[16]; - union { - uint8_t set_uuid[16]; - uint64_t set_magic; - }; - uint8_t label[SB_LABEL_SIZE]; - - uint64_t flags; - uint64_t seq; - uint64_t pad[8]; - - union { - struct { - /* Cache devices */ - uint64_t nbuckets; /* device size */ - - uint16_t block_size; /* sectors */ - uint16_t bucket_size; /* sectors */ - - uint16_t nr_in_set; - uint16_t nr_this_dev; - }; - struct { - /* Backing devices */ - uint64_t data_offset; - - /* - * block_size from the cache device section is still used by - * backing devices, so don't add anything here until we fix - * things to not need it for backing devices anymore - */ - }; - }; - - uint32_t last_mount; /* time_t */ - - uint16_t first_bucket; - union { - uint16_t njournal_buckets; - uint16_t keys; - }; - uint64_t d[SB_JOURNAL_BUCKETS]; /* journal buckets */ + uint8_t magic[16]; /* bcache file system identifier */ + uint8_t uuid[16]; /* device identifier */ }; /* magic string */ |