1
0
Fork 0
alistair23-linux/include
Damien Le Moal bf50545696 block: Introduce blk_revalidate_disk_zones()
Drivers exposing zoned block devices have to initialize and maintain
correctness (i.e. revalidate) of the device zone bitmaps attached to
the device request queue (seq_zones_bitmap and seq_zones_wlock).

To simplify coding this, introduce a generic helper function
blk_revalidate_disk_zones() suitable for most (and likely all) cases.
This new function always update the seq_zones_bitmap and seq_zones_wlock
bitmaps as well as the queue nr_zones field when called for a disk
using a request based queue. For a disk using a BIO based queue, only
the number of zones is updated since these queues do not have
schedulers and so do not need the zone bitmaps.

With this change, the zone bitmap initialization code in sd_zbc.c can be
replaced with a call to this function in sd_zbc_read_zones(), which is
called from the disk revalidate block operation method.

A call to blk_revalidate_disk_zones() is also added to the null_blk
driver for devices created with the zoned mode enabled.

Finally, to ensure that zoned devices created with dm-linear or
dm-flakey expose the correct number of zones through sysfs, a call to
blk_revalidate_disk_zones() is added to dm_table_set_restrictions().

The zone bitmaps allocated and initialized with
blk_revalidate_disk_zones() are freed automatically from
__blk_release_queue() using the block internal function
blk_queue_free_zone_bitmaps().

Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-10-25 11:17:40 -06:00
..
acpi pci-v4.20-changes 2018-10-25 06:50:48 -07:00
asm-generic Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2018-10-24 11:49:35 +01:00
clocksource
crypto
drm drm: Get ref on CRTC commit object when waiting for flip_done 2018-10-18 14:23:13 -04:00
dt-bindings pci-v4.20-changes 2018-10-25 06:50:48 -07:00
keys
kvm
linux block: Introduce blk_revalidate_disk_zones() 2018-10-25 11:17:40 -06:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
memory
misc
net tcp: add tcp_reset_xmit_timer() helper 2018-10-23 19:42:44 -07:00
pcmcia
ras
rdma RDMA/netdev: Fix netlink support in IPoIB 2018-10-10 17:58:12 -07:00
scsi
soc net/wan/fsl_ucc_hdlc: error counters 2018-10-22 19:58:10 -07:00
sound ASoC: Updates for v5.0/v4.20 2018-10-22 23:26:37 +02:00
target scsi: target/core: Remove the SCF_COMPARE_AND_WRITE_POST flag 2018-10-16 01:13:35 -04:00
trace block: add a report_zones method 2018-10-25 11:17:40 -06:00
uapi block: Introduce BLKGETNRZONES ioctl 2018-10-25 11:17:40 -06:00
video
xen Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-10-23 17:54:58 +01:00