Revisiting this...
On 09/04/2019 13:35, Christoph Hellwig wrote:
On Tue, Apr 09, 2019 at 01:21:23PM +0100, Steven Whitehouse wrote:
Those conversion functions are not sensible, thats why we got rid of them
from the kernel code. It is better to have a set of types that have the
endianess specified so that we can use sparse. Compile time checking is
always a good plan where it is possible.
Yeah. And <linux/types.h> vs inttypes.h is no argument either,
you can define the __be types based on the inttypes.h types (which
really are stdint.h ones anyway).
Linux's __be* type definitions are pulled in by standard headers (e.g.
sys/stat.h via bits/statx.h -> linux/stat.h -> linux/types.h) so they
can't be redefined in terms of stdint.h types, unfortunately. Even if
that did work it could easily be broken outside of our control in the
future, so that's another reason to leave the __be* types alone.
So I think the best we can do is define some new bitwise-annotated types
based on stdint.h and change the imported gfs2_ondisk.h to use them.
Andy