xfs
[Top] [All Lists]

Re: [PATCH 5/6] xfstests: Define fallocate flags locally in fsx

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 5/6] xfstests: Define fallocate flags locally in fsx
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 25 Feb 2014 13:56:16 -0800
Cc: Lukas Czerner <lczerner@xxxxxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140225203922.GC13647@dastard>
References: <1393355728-12056-1-git-send-email-lczerner@xxxxxxxxxx> <1393355728-12056-5-git-send-email-lczerner@xxxxxxxxxx> <20140225203922.GC13647@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Feb 26, 2014 at 07:39:22AM +1100, Dave Chinner wrote:
> > index b3c30db..331257e 100644
> > --- a/ltp/fsx.c
> > +++ b/ltp/fsx.c
> > @@ -35,8 +35,13 @@
> >  #endif
> >  #ifdef FALLOCATE
> >  #include <linux/falloc.h>
> > +#ifndef FALLOC_FL_PUNCH_HOLE
> > +#define FALLOC_FL_PUNCH_HOLE    0x02 /* de-allocates range */
> > +#endif
> > +#ifndef FALLOC_FL_ZERO_RANGE
> > +#define FALLOC_FL_ZERO_RANGE    0x10 /* zeroes range */
> > +#endif
> >  #endif
> 
> This pattern is appearing all over the place in xfstests now.  I'd
> suggest that this should really be handled by autoconf,
> include/config.h and src/globals.h....

Can we handle this nicely using autoconf, especially in the case of O_
flags that might be different for different architectures?

Either way having a single header for the various flags that might not
be present in the system headers sounds like a good plan.

<Prev in Thread] Current Thread [Next in Thread>