On Wed, Dec 23 2020 at 6:26am -0500, Jeffle Xu <jefflexu@xxxxxxxxxxxxxxxxx> wrote: > Sometimes we need to get the corresponding gendisk from request_queue. > > One such use case is that, the block device driver had ever stored the > same private data both in queue->queuedata and gendisk->private_data, > while nowadays gendisk->private_data is more preferable in such case, > e.g. commit c4a59c4e5db3 ("dm: stop using ->queuedata"). So if only > request_queue given, we need to get the corresponding gendisk from > queue, to get the private data stored in gendisk. > > Signed-off-by: Jeffle Xu <jefflexu@xxxxxxxxxxxxxxxxx> > --- > include/linux/blkdev.h | 2 ++ > include/trace/events/kyber.h | 6 +++--- > 2 files changed, 5 insertions(+), 3 deletions(-) Looks good, but please update the patch subject and header to be: block: add queue_to_disk() to get gendisk from request_queue Sometimes we need to get the corresponding gendisk from request_queue. It is preferred that block drivers store private data in gendisk->private_data rather than request_queue->queuedata, e.g. see: commit c4a59c4e5db3 ("dm: stop using ->queuedata"). So if only request_queue is given, we need to get its corresponding gendisk to get the private data stored in that gendisk. Signed-off-by: Jeffle Xu <jefflexu@xxxxxxxxxxxxxxxxx> Review-by: Mike Snitzer <snitzer@xxxxxxxxxx>