Skip to content

Commit 1008162

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 471aa70 commit 1008162

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/blkdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ extern void blk_clear_pm_only(struct request_queue *q);
664664
dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \
665665
(dir), (attrs))
666666

667+
#define queue_has_disk(q) ((q)->kobj.parent != NULL)
667668
#define queue_to_disk(q) (dev_to_disk(kobj_to_dev((q)->kobj.parent)))
668669

669670
static inline bool queue_is_mq(struct request_queue *q)

0 commit comments

Comments
 (0)