Whamcloud - gitweb
libext2fs: revamp bitmap types to fix LTO warnings
authorTheodore Ts'o <tytso@mit.edu>
Wed, 8 Aug 2018 17:53:11 +0000 (13:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 8 Aug 2018 17:53:11 +0000 (13:53 -0400)
commit83d9ffccf3ee6ad4e165eeb6912acf1f6149be28
tree3cf8ccea465498d4253a9dc61dc1d25bce94dbd1
parentbcca786b836a4f2764b16489c41f2d1239faaa01
libext2fs: revamp bitmap types to fix LTO warnings

We play games with pointers to incomplete types to handle subclassing
using the C language, use the first four bytes (the magic number)
field to disambiguate between different subclasses.  The way we were
doing it before, we relied defining the structure differently
depending on the C file implementing different backend subclasses.

This triggers LTO warnings, since it appears (and in fact, we are)
using functions defined with different types than how they were
defined by calling C file.

Fix the LTO warnings by using an explicit base bitmap structure, and
then casting it to the 32-bit or 64-bit variant as needed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/bitmaps.c
lib/ext2fs/blkmap64_ba.c
lib/ext2fs/blkmap64_rb.c
lib/ext2fs/bmap64.h
lib/ext2fs/ext2fs.h
lib/ext2fs/gen_bitmap.c
lib/ext2fs/gen_bitmap64.c