diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2025-04-22 21:19:30 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2025-05-04 11:35:05 +0200 |
| commit | f1e24048edb4c51678948cc6a08d20b57cde1471 (patch) | |
| tree | 8e1619ecd111e1d4b974d54c009544e51c6eaefc /drivers/md/dm.c | |
| parent | 33304b75df651bda2d34394e59cd9ee4e3c07602 (diff) | |
| download | linux-next-f1e24048edb4c51678948cc6a08d20b57cde1471.tar.gz linux-next-f1e24048edb4c51678948cc6a08d20b57cde1471.zip | |
dm: use generic functions instead of disable_discard and disable_write_zeroes
A small code cleanup: use blk_queue_disable_discard and
blk_queue_disable_write_zeroes instead of disable_discard and
disable_write_zeroes.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
| -rw-r--r-- | drivers/md/dm.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 240f6dab8dda..ccccc098b30e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1082,22 +1082,6 @@ static inline struct queue_limits *dm_get_queue_limits(struct mapped_device *md) return &md->queue->limits; } -void disable_discard(struct mapped_device *md) -{ - struct queue_limits *limits = dm_get_queue_limits(md); - - /* device doesn't really support DISCARD, disable it */ - limits->max_hw_discard_sectors = 0; -} - -void disable_write_zeroes(struct mapped_device *md) -{ - struct queue_limits *limits = dm_get_queue_limits(md); - - /* device doesn't really support WRITE ZEROES, disable it */ - limits->max_write_zeroes_sectors = 0; -} - static bool swap_bios_limit(struct dm_target *ti, struct bio *bio) { return unlikely((bio->bi_opf & REQ_SWAP) != 0) && unlikely(ti->limit_swap_bios); @@ -1115,10 +1099,10 @@ static void clone_endio(struct bio *bio) if (unlikely(error == BLK_STS_TARGET)) { if (bio_op(bio) == REQ_OP_DISCARD && !bdev_max_discard_sectors(bio->bi_bdev)) - disable_discard(md); + blk_queue_disable_discard(md->queue); else if (bio_op(bio) == REQ_OP_WRITE_ZEROES && !bdev_write_zeroes_sectors(bio->bi_bdev)) - disable_write_zeroes(md); + blk_queue_disable_write_zeroes(md->queue); } if (static_branch_unlikely(&zoned_enabled) && |
