On Wed, Apr 14, 2021 at 10:33:39AM +0900, Naohiro Aota wrote:
> +static int is_conventional(blkid_probe pr, uint64_t offset)
> +{
> + struct blk_zone_report *rep = NULL;
> + size_t rep_size;
> + int ret;
> + uint64_t zone_mask;
> +
> + if (!pr->zone_size)
> + return 1;
> +
> + rep_size = sizeof(struct blk_zone_report) + sizeof(struct blk_zone);
> + rep = calloc(1, rep_size);
> + if (!rep)
> + return -1;
> +
> + zone_mask = ~(pr->zone_size - 1);
> + rep->sector = (offset & zone_mask) >> 9;
> + rep->nr_zones = 1;
> + ret = ioctl(blkid_probe_get_fd(pr), BLKREPORTZONE, rep);
> + if (ret) {
> + free(rep);
> + return -1;
> + }
ret = blkdev_get_zonereport()
:-)
> /**
> * blkid_do_wipe:
> * @pr: prober
> @@ -1267,6 +1310,7 @@ int blkid_do_wipe(blkid_probe pr, int dryrun)
> const char *off = NULL;
> size_t len = 0;
> uint64_t offset, magoff;
> + bool conventional;
BTW, nowhere in libblkid we use "bool". It would be probably better to include
<stdbool.h> to blkidP.h.
Karel
--
Karel Zak <[email protected]>
http://karelzak.blogspot.com