uint64_t nsectors = xi->data.size;
if (cfg->rtstart && zt->data.nr_zones) {
- reset_zones(cfg, xi->data.fd, cfg->rtstart, xi->rt.size,
- quiet);
+ /*
+ * Note that the zone reset here includes the LBA range
+ * for the data device.
+ *
+ * This is because doing a single zone reset all on the
+ * entire device (which the kernel automatically does
+ * for us for a full device range) is a lot faster than
+ * resetting each zone individually and resetting
+ * the conventional zones used for the data device is a
+ * no-op.
+ */
+ reset_zones(cfg, xi->data.fd, 0,
+ cfg->rtstart + xi->rt.size, quiet);
nsectors -= cfg->rtstart;
}
discard_blocks(xi->data.fd, nsectors, quiet);