Skip to content

Commit

Permalink
block: add a queue_has_disk helper
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Aug 9, 2021
1 parent 471aa70 commit 1008162
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1008162

Please sign in to comment.