]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: use blkdev_report_zones_cached()
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 28 Jan 2026 04:32:56 +0000 (05:32 +0100)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 28 Jan 2026 09:54:36 +0000 (10:54 +0100)
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 <dlemoal@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
include/platform_defs.h
libxfs/xfs_zones.c

index 1152f0622ccf43a1894c5addeadb1a0aace27763..1a9f401fc11c965738717cdc9542949681dff873 100644 (file)
@@ -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 <linux/blkzoned.h> doesn't provide them yet.
+ */
+#ifndef BLK_ZONE_COND_ACTIVE
+#define BLK_ZONE_COND_ACTIVE   0xff
+#endif
+
 #endif /* __XFS_PLATFORM_DEFS_H__ */
index c1ad7075329c0ac65334f9dd4fa6902c31bad43a..90e2ba0908be5d458abd978fdca9ecba362da523 100644 (file)
@@ -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);