summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-05-24 18:03:04 +0300
committerDavid Sterba <dsterba@suse.com>2023-06-19 14:59:32 +0300
commitdd8b7b0416704efb0dcd74801a1a48aa221f1cf5 (patch)
tree99a7aff42b738e57a256676551143d12389f3185 /fs/btrfs
parent99f09ce309b8307ce8dca209f936e99a7c332214 (diff)
downloadlinux-dd8b7b0416704efb0dcd74801a1a48aa221f1cf5.tar.xz
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 <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
index 840e4def18b5..5dd24c2916a1 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;
}
/*