[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2822BB00-1A19-4DE4-8532-63FC307E5D7B@dilger.ca>
Date: Mon, 26 Jun 2017 15:45:50 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: Tahsin Erdogan <tahsin@...gle.com>
Cc: "Darrick J . Wong" <darrick.wong@...cle.com>,
Theodore Ts'o <tytso@....edu>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 07/12] e2fsck: track ea_inode references
On Jun 26, 2017, at 7:43 AM, Tahsin Erdogan <tahsin@...gle.com> wrote:
>
> An extended attribute inode has a ref count to track how many entries
> point to it. Update e2fsck to verify that the stored ref count is
> correct.
>
> Signed-off-by: Tahsin Erdogan <tahsin@...gle.com>
> ---
> diff --git a/e2fsck/message.c b/e2fsck/message.c
> index 34201a37fd4b..525f4a1e7628 100644
> --- a/e2fsck/message.c
> +++ b/e2fsck/message.c
> @@ -466,6 +466,13 @@ static _INLINE_ void expand_percent_expression(FILE *f, ext2_filsys fs,
> fprintf(f, "%*u", width, ctx->num);
> #else
> fprintf(f, "%*llu", width, (long long)ctx->num);
> +#endif
> + break;
> + case 'n':
> +#ifdef EXT2_NO_64_TYPE
> + fprintf(f, "%*u", width, ctx->num2);
> +#else
> + fprintf(f, "%*llu", width, (long long)ctx->num2);
> #endif
Rather than a series of "#ifdef EXT2_NO_64_TYPE" checks, it would be cleaner
to have a single #define to set the printf type, like:
#ifdef EXT2_NO_64_TYPE
#define EXT2_64U "%*u"
#define EXT2_64D "%*d"
#define EXT2_64X "%*x"
#else
#define EXT2_64U "%*llu"
#define EXT2_64D "%*lld"
#define EXT2_64X "%*llx"
#endif
and then use "EXT2_64D" or "EXT2_64U" in all of these fprintf() statements.
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists