linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Justin Maggard <jmaggard10@gmail.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] Fix EXT4_FEATURE_RO_COMPAT_HUGE_FILE check
Date: Tue, 24 Aug 2010 11:41:11 -0500	[thread overview]
Message-ID: <4C73F627.2000809@redhat.com> (raw)
In-Reply-To: <426FFD16-98B3-4427-BDA5-C80CE184781C@dilger.ca>

Andreas Dilger wrote:

> This isn't the first time that we've had problems like this, and it
> won't be the last time unless there is a better API for checking
> these flags.

*nod*
 
> I've long thought about having something like:

Same thing crossed my mind; seems like a very good idea.

> #define EXT4_CHECK_COMPAT(sb, flag)    ((super)->s_feature_compat &     \
>                                           EXT4_FEATURE_COMPAT_ ## flag)
> #define EXT4_CHECK_RO_COMPAT(sb, flag) ((super)->s_feature_ro_compat &     \
>                                           EXT4_FEATURE_RO_COMPAT_ ## flag)
> #define EXT4_CHECK_INCOMPAT(sb, flag)  ((super)->s_feature_incompat &     \
>                                           EXT4_FEATURE_INCOMPAT_ ## flag)
> #define EXT4_SET_COMPAT(sb, flag)    do { (super)->s_feature_compat |=     \
>                                          EXT4_FEATURE_COMPAT_ ## flag; } while(0)
> #define EXT4_SET_RO_COMPAT(sb, flag) do { (super)->s_feature_ro_compat |=     \
>                                          EXT4_FEATURE_RO_COMPAT_ ##flag;} while(0)
> #define EXT4_SET_INCOMPAT(sb, flag)  do { (super)->s_feature_incompat |=     \
>                                          EXT4_FEATURE_INCOMPAT_ ## flag;} while(0)
> 
> This will produce a compile error if the flag name and the macro name
> don't match. Unfortunately, for e2fsprogs we will need 3 sets of such
> macros because the feature flags are named EXT2_*, EXT3_*, and
> EXT4_*, depending on when they were added. For the kernel code that
> wouldn't be needed.

Time to name them consistently in e2fsprogs, then, I think?

-Eric

> Cheers, Andreas


  reply	other threads:[~2010-08-24 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  1:34 [PATCH] Fix EXT4_FEATURE_RO_COMPAT_HUGE_FILE check Justin Maggard
2010-08-24  4:34 ` Andreas Dilger
2010-08-24 16:41   ` Eric Sandeen [this message]
2010-08-24 19:32     ` Justin Maggard
2010-11-22 22:34 ` Ted Ts'o

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=4C73F627.2000809@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=jmaggard10@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    /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).