From: Christoph Hellwig Date: Wed, 24 May 2023 15:03:04 +0000 (+0200) Subject: btrfs: optimize out btrfs_is_zoned for !CONFIG_BLK_DEV_ZONED X-Git-Tag: v6.6.7~2168^2~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd8b7b0416704efb0dcd74801a1a48aa221f1cf5;p=platform%2Fkernel%2Flinux-starfive.git btrfs: optimize out btrfs_is_zoned for !CONFIG_BLK_DEV_ZONED Add an IS_ENABLED check for CONFIG_BLK_DEV_ZONED in addition to the run-time check for the zone size. This will allow to make use of compiler dead code elimination for code guarded by btrfs_is_zoned, and for example provide just a dangling prototype for a function instead of adding a stub. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h index 840e4de..5dd24c2 100644 --- a/fs/btrfs/fs.h +++ b/fs/btrfs/fs.h @@ -853,7 +853,7 @@ static inline u64 btrfs_calc_metadata_size(const struct btrfs_fs_info *fs_info, static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info) { - return fs_info->zone_size > 0; + return IS_ENABLED(CONFIG_BLK_DEV_ZONED) && fs_info->zone_size > 0; } /*