public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: chandan.babu@oracle.com, djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: compile out v4 support if disabled
Date: Wed, 20 Mar 2024 08:05:13 +1100	[thread overview]
Message-ID: <Zfn+CTA88U78hiQw@dread.disaster.area> (raw)
In-Reply-To: <20240319071952.682266-1-hch@lst.de>

On Tue, Mar 19, 2024 at 05:19:51PM +1000, Christoph Hellwig wrote:
> Add a strategic IS_ENABLED to let the compiler eliminate the unused
> non-crc code is CONFIG_XFS_SUPPORT_V4 is disabled.
> 
> This saves almost 20k worth of .text for my .config:
> 
> $ size xfs.o.*
>    text	   data	    bss	    dec	    hex	filename
> 1351126	 294836	    592	1646554	 191fda	xfs.o.new
> 1371453	 294868	    592	1666913	 196f61	xfs.o.old
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_mount.h |  7 ++++++-
>  fs/xfs/xfs_super.c | 22 +++++++++++++---------
>  2 files changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index e880aa48de68bb..24fe6e7913c49f 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -327,6 +327,12 @@ static inline void xfs_add_ ## name (struct xfs_mount *mp) \
>  	xfs_sb_version_add ## name(&mp->m_sb); \
>  }
>  
> +static inline bool xfs_has_crc(struct xfs_mount *mp)
> +{
> +	return IS_ENABLED(CONFIG_XFS_SUPPORT_V4) &&
> +		(mp->m_features & XFS_FEAT_CRC);
> +}

Is that right? This can only return true if V4 support is compiled
in, but it should be the other way around - always return true if
V4 support is not compiled in. i.e:

	if (!IS_ENABLED(CONFIG_XFS_SUPPORT_V4))
		return true;
	return mp->m_features & XFS_FEAT_CRC;

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2024-03-22  0:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  7:19 [PATCH] xfs: compile out v4 support if disabled Christoph Hellwig
2024-03-19 17:59 ` Darrick J. Wong
2024-03-19 20:09   ` Christoph Hellwig
2024-03-19 21:13   ` Dave Chinner
2024-03-22  3:24     ` Christoph Hellwig
2024-03-19 21:05 ` Dave Chinner [this message]
2024-03-22  3:25   ` Christoph Hellwig

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=Zfn+CTA88U78hiQw@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@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