On Wed, Aug 03, 2022 at 11:48:01AM +0200, Pankaj Raghav wrote: > Only zoned devices with power-of-2(po2) zone sizes were supported in linux > but now non power-of-2(npo2) zone sizes support has been added to the > block layer. Would it make sense to replace this first paragraph with: " Only zoned devices with power-of-2(po2) zone sizes (in number of sectors) were supported in linux but now non power-of-2(npo2) values are supported in the block layer. " ? In this way you have made clear that zone sizes are in number of sectors and every time you reference it afterwards, it is implied that it is in number of sectors. otherwise LGTM Reviewed-by: Joel Granados > > Filesystems such as F2FS and btrfs have support for zoned devices with > po2 zone size assumption. Before adding native support for npo2 zone > sizes, it was suggested to create a dm target for npo2 zone size device to > appear as a po2 size zoned target so that file systems can initially work > without any explicit changes by using this target. > > The design of this target is very simple: remap the device zone size to > the zone capacity and change the zone size to be the nearest power of 2 > number of sectors. > > For e.g., a device with a zone size/capacity of 3M will have an equivalent > target layout as follows: > > Device layout :- > zone capacity = 3M > zone size = 3M > > |--------------|-------------| > 0 3M 6M > > Target layout :- > zone capacity=3M > zone size = 4M > > |--------------|---|--------------|---| > 0 3M 4M 7M 8M > > The area between target's zone capacity and zone size will be emulated > in the target. > The read IOs that fall in the emulated gap area will return 0 filled > bio and all the other IOs in that area will result in an error. > If a read IO span across the emulated area boundary, then the IOs are > split across them. All other IO operations that span across the emulated > area boundary will result in an error. > > The target can be easily created as follows: > dmsetup create