diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-15 06:52:42 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 03:49:59 +0200 |
commit | 10f0d2a517796b8f6dc04fb0cc3e49003ae6b0bc (patch) | |
tree | 294ac1a4503f37520ebbc866e4c7313818b27d77 /drivers/md/dm-table.c | |
parent | mm: use bdev_is_zoned in claim_swapfile (diff) | |
download | linux-10f0d2a517796b8f6dc04fb0cc3e49003ae6b0bc.tar.xz linux-10f0d2a517796b8f6dc04fb0cc3e49003ae6b0bc.zip |
block: add a bdev_nonrot helper
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: David Sterba <dsterba@suse.com> [btrfs]
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-12-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 03541cfc2317..5e38d0dd009d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti, static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev, sector_t start, sector_t len, void *data) { - struct request_queue *q = bdev_get_queue(dev->bdev); - - return !blk_queue_nonrot(q); + return !bdev_nonrot(dev->bdev); } static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev, |