提交 1008162b 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: add a queue_has_disk helper

Add a helper to check if a gendisk is associated with a request_queue.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NJan Kara <jack@suse.cz>
Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210809141744.1203023-4-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 471aa704
......@@ -664,6 +664,7 @@ extern void blk_clear_pm_only(struct request_queue *q);
dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \
(dir), (attrs))
#define queue_has_disk(q) ((q)->kobj.parent != NULL)
#define queue_to_disk(q) (dev_to_disk(kobj_to_dev((q)->kobj.parent)))
static inline bool queue_is_mq(struct request_queue *q)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册