From: Andrew Price Date: Fri, 8 Nov 2019 09:50:00 +0000 Subject: [Cluster-devel] [PATCH] libgfs2: Import gfs2_ondisk.h In-Reply-To: <20190409123510.GA27246@infradead.org> References: <20190409094153.3343-1-anprice@redhat.com> <20190409120304.GA16296@infradead.org> <58b0f320-407b-bae0-d261-9182b3b5912c@redhat.com> <20190409123510.GA27246@infradead.org> Message-ID: <8967ad5b-2a4c-ddba-2386-fff7533458fc@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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