zbd: don't lock zones outside working area
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 21 May 2020 23:17:14 +0000 (02:17 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 May 2020 23:23:10 +0000 (17:23 -0600)
commitfae3b9a0af400f4e4c576d35bf97ef655be5fc78
tree321380336d3027122169df8a4ff06857cee47741
parentaf7be579816c5636e3b6fc07dee745d52aefd4d4
zbd: don't lock zones outside working area

Currently threads lock each other zones even if their working areas as
defined by [f->file_offset, f->file_offset + f->io_size) don't intersect.
This leads to unnecessary quiescing.

Patch clamps every zone to [->min_zone, ->max_zone) when doing search
for opened zone and more importantly adds an assert so that any
unnecessary zone locking becomes very visible.

Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
file.h
zbd.c