diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-04-12 06:54:19 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-02 23:48:09 +0200 |
commit | 3f9b8fb46e5d20eac314f56747e24e1a4e74539d (patch) | |
tree | bd24e449d106c15ebb750ba34abfbeecd83c0ff8 /block | |
parent | Linux 6.9-rc2 (diff) | |
download | linux-3f9b8fb46e5d20eac314f56747e24e1a4e74539d.tar.xz linux-3f9b8fb46e5d20eac314f56747e24e1a4e74539d.zip |
Use bdev_is_paritition() instead of open-coding it
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 5 | ||||
-rw-r--r-- | block/blk-mq.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index a16b5abdbbf5..20322abc6082 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -759,7 +759,8 @@ void submit_bio_noacct(struct bio *bio) if (!bio_flagged(bio, BIO_REMAPPED)) { if (unlikely(bio_check_eod(bio))) goto end_io; - if (bdev->bd_partno && unlikely(blk_partition_remap(bio))) + if (bdev_is_partition(bdev) && + unlikely(blk_partition_remap(bio))) goto end_io; } @@ -989,7 +990,7 @@ again: if (likely(try_cmpxchg(&part->bd_stamp, &stamp, now))) __part_stat_add(part, io_ticks, end ? now - stamp : 1); } - if (part->bd_partno) { + if (bdev_is_partition(part)) { part = bdev_whole(part); goto again; } diff --git a/block/blk-mq.c b/block/blk-mq.c index 32afb87efbd0..43bb8f50a07c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -92,7 +92,7 @@ static bool blk_mq_check_inflight(struct request *rq, void *priv) struct mq_inflight *mi = priv; if (rq->part && blk_do_io_stat(rq) && - (!mi->part->bd_partno || rq->part == mi->part) && + (!bdev_is_partition(mi->part) || rq->part == mi->part) && blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) mi->inflight[rq_data_dir(rq)]++; |