From: Damien Le Moal Date: Wed, 28 Jan 2026 04:32:56 +0000 (+0100) Subject: xfs: use blkdev_report_zones_cached() X-Git-Tag: v6.19.0~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3d17aa18f73d8183cbb9b9d5c7ceda6ed6f7241;p=xfsprogs-dev.git xfs: use blkdev_report_zones_cached() Source kernel commit: e04ccfc28252f181ea8d469d834b48e7dece65b2 Modify xfs_mount_zones() to replace the call to blkdev_report_zones() with blkdev_report_zones_cached() to speed-up mount operations. Since this causes xfs_zone_validate_seq() to see zones with the BLK_ZONE_COND_ACTIVE condition, this function is also modified to acept this condition as valid. With this change, mounting a freshly formatted large capacity (30 TB) SMR HDD completes under 2s compared to over 4.7s before. Signed-off-by: Damien Le Moal Reviewed-by: Martin K. Petersen Signed-off-by: Jens Axboe Signed-off-by: Christoph Hellwig --- diff --git a/include/platform_defs.h b/include/platform_defs.h index 1152f062..1a9f401f 100644 --- a/include/platform_defs.h +++ b/include/platform_defs.h @@ -308,4 +308,12 @@ struct kvec { size_t iov_len; }; +/* + * Local definitions for the new cached report zones added in Linux 6.19 in case + * the system doesn't provide them yet. + */ +#ifndef BLK_ZONE_COND_ACTIVE +#define BLK_ZONE_COND_ACTIVE 0xff +#endif + #endif /* __XFS_PLATFORM_DEFS_H__ */ diff --git a/libxfs/xfs_zones.c b/libxfs/xfs_zones.c index c1ad7075..90e2ba09 100644 --- a/libxfs/xfs_zones.c +++ b/libxfs/xfs_zones.c @@ -96,6 +96,7 @@ xfs_zone_validate_seq( case BLK_ZONE_COND_IMP_OPEN: case BLK_ZONE_COND_EXP_OPEN: case BLK_ZONE_COND_CLOSED: + case BLK_ZONE_COND_ACTIVE: return xfs_zone_validate_wp(zone, rtg, write_pointer); case BLK_ZONE_COND_FULL: return xfs_zone_validate_full(zone, rtg, write_pointer);