diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2019-11-11 05:39:29 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-13 05:12:04 +0300 |
commit | 23a50861adda26a3f3b3ec5fbca0583133d89538 (patch) | |
tree | eb14d3c23dca0b31c45c31d637a77b18c061885e /drivers/block/null_blk.h | |
parent | 6d09c4086ed9fc72afb3be4b47ecfa34f57f15f9 (diff) | |
download | linux-23a50861adda26a3f3b3ec5fbca0583133d89538.tar.xz |
scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer()
There is no need to arbitrarily limit the size of a report zone to the
number of zones defined by SD_ZBC_REPORT_MAX_ZONES. Rather, simply
calculate the report buffer size needed for the requested number of
zones without exceeding the device total number of zones. This buffer
size limitation to the hardware maximum transfer size and page mapping
capabilities is kept unchanged. Starting with this initial buffer size,
the allocation is optimized by iterating over decreasing buffer size
until the allocation succeeds (each iteration is allowed to fail fast
using the __GFP_NORETRY flag). This ensures forward progress for zone
reports and avoids failures of zones revalidation under memory pressure.
While at it, also replace the hard coded 512 B sector size with the
SECTOR_SIZE macro.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk.h')
0 files changed, 0 insertions, 0 deletions