Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: add a queue_has_disk helper

Add a helper to check if a gendisk is associated with a request_queue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210809141744.1203023-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
1008162b 471aa704

+1
+1
include/linux/blkdev.h
··· 664 664 dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \ 665 665 (dir), (attrs)) 666 666 667 + #define queue_has_disk(q) ((q)->kobj.parent != NULL) 667 668 #define queue_to_disk(q) (dev_to_disk(kobj_to_dev((q)->kobj.parent))) 668 669 669 670 static inline bool queue_is_mq(struct request_queue *q)