linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Lukas Czerner <lczerner@redhat.com>,
	linux-ext4@vger.kernel.org, xfs@oss.sgi.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 5/6] xfstests: Define fallocate flags locally in fsx
Date: Wed, 26 Feb 2014 17:07:33 +1100	[thread overview]
Message-ID: <20140226060733.GT13647@dastard> (raw)
In-Reply-To: <20140225215616.GA29752@infradead.org>

On Tue, Feb 25, 2014 at 01:56:16PM -0800, Christoph Hellwig wrote:
> 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?

I think so, because config.h is generated from config.h.in and
ends up looking like:

#define HAVE_SOME_FUNCTION 1

src/globals.h is controlled directly by us, and ends up looking
like:

#ifdef HAVE_SOME_FUNCTION
#include <header_for_some_function.h>
#endif

If we add all the defines that may be missing that same ifdef
section, and make sure that all code includes globals.h, then
all the code will have the "HAVE_SOME_FUNCTION" defines and the
appropriate header files and definitions included.

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

*nod*

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2014-02-26  6:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 19:15 [PATCH 1/6] generic/290: Add test for fallocate zero range Lukas Czerner
2014-02-25 19:15 ` [PATCH 2/6] xfstests: Add fallocate zero range operation to fsstress Lukas Czerner
2014-02-25 20:15   ` Dave Chinner
2014-02-25 19:15 ` [PATCH 3/6] xfstests: fsstress punch should always have FALLOC_FL_KEEP_SIZE set Lukas Czerner
2014-02-25 20:18   ` Dave Chinner
2014-02-26 13:04     ` Lukáš Czerner
2014-02-25 19:15 ` [PATCH 4/6] xfstests: Add fallocate zero range operation to fsx Lukas Czerner
2014-02-25 20:31   ` Dave Chinner
2014-02-25 19:15 ` [PATCH 5/6] xfstests: Define fallocate flags locally in fsx Lukas Czerner
2014-02-25 20:39   ` Dave Chinner
2014-02-25 21:56     ` Christoph Hellwig
2014-02-26  6:07       ` Dave Chinner [this message]
2014-02-25 19:15 ` [PATCH 6/6] ext4/242: Add ext4 specific test for fallocate zero range Lukas Czerner
2014-02-25 20:53   ` Dave Chinner
2014-02-25 21:01     ` Lukáš Czerner
2014-02-25 21:27       ` Lukáš Czerner
2014-02-25 21:50       ` Dave Chinner
2014-02-26 14:24         ` Lukáš Czerner
2014-02-26 22:01           ` Dave Chinner
2014-02-27 12:03             ` Lukáš Czerner
2014-02-27 19:35               ` Dave Chinner
2014-02-28 12:38                 ` Lukáš Czerner
2014-02-26 14:58         ` Lukáš Czerner
2014-02-26 22:17           ` Dave Chinner
2014-02-27 11:48             ` Lukáš Czerner
2014-02-25 20:01 ` [PATCH 1/6] generic/290: Add " Dave Chinner
2014-02-25 20:55   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140226060733.GT13647@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).