[dm-devel] [PATCH RFC 2/7] block: add helper function fetching gendisk from queue
Mike Snitzer
snitzer at redhat.com
Thu Jan 7 20:31:21 UTC 2021
On Wed, Dec 23 2020 at 6:26am -0500,
Jeffle Xu <jefflexu at linux.alibaba.com> 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 at linux.alibaba.com>
> ---
> 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 at linux.alibaba.com>
Review-by: Mike Snitzer <snitzer at redhat.com>
More information about the dm-devel
mailing list