[PATCH] arm64: Move struct stat64 to uapi.

Will Deacon will.deacon at arm.com
Wed Jul 16 06:27:08 PDT 2014


On Tue, Jul 15, 2014 at 11:33:33AM +0100, Ian Campbell wrote:
> On Tue, 2014-07-15 at 09:20 +0100, Will Deacon wrote:
> > Hmm, but struct kstat is defined in linux/stat.h so I'm not sure why this is
> > arm64-specific. linux/fs.h includes that on line 10.
> 
> That include won't do anything because we already got here via
> linux/stat.h (6th line of "In file included from" above), so the guard
> has already been defined. IOW there is a loop in the includes, which
> starts before kstat is struct defined:
> 
> linux/stat.h -> asm/stat.h -> arm/compat.h -> linux/ptrace.h ->
> linux_pidnamespace.h -> linux/mm.h -> linux/fs.h
> 
> The last link here is added by aufs patches, but all the other arches
> are ok with this because none of them have asm/stat.h, they only have
> uapi/asm/stat.h.
> 
> The issue ultimately is down to the asm/stat.h -> asm/compat.h link
> though I think so an alternative fix could be to switch to a different
> set of types for the existing definition and ditching asm/compat.h from
> asm/stat.h. I don't think that's the correct fix though.

Perhaps we could split asm/compat.h into asm/compat-types.h containing just
the type definitions, then asm/compat.h can include that as well as defining
any functions and macros.

Then asm/stat.h just needs to include asm/compat-types.h to avoid the
issue.

> > Can you help me unconfuse myself, please?
> 
> I hope I've managed to reduce rather than increase the confusion ;-)

I think so, but it hurt :)

Will



More information about the linux-arm-kernel mailing list