dm: introduce dm_remap_zone_report()
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 8 May 2017 23:40:48 +0000 (16:40 -0700)
committerMike Snitzer <snitzer@redhat.com>
Mon, 19 Jun 2017 15:03:51 +0000 (11:03 -0400)
commit10999307c14eac281fbec3ada73bee7a05bd41dc
treef8898affec3c6857bfe1dcf86fd44160443d9fea
parent264c869d44dcff17e3b108dbb2fbea24bed08538
dm: introduce dm_remap_zone_report()

A target driver support zoned block devices and exposing it as such may
receive REQ_OP_ZONE_REPORT request for the user to determine the mapped
device zone configuration. To process properly such request, the target
driver may need to remap the zone descriptors provided in the report
reply. The helper function dm_remap_zone_report() does this generically
using only the target start offset and length and the start offset
within the target device.

dm_remap_zone_report() will remap the start sector of all zones
reported. If the report includes sequential zones, the write pointer
position of these zones will also be remapped.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm.c
include/linux/device-mapper.h