Thread (26 messages) flat view 26 messages, 2 authors, 2021-01-14

Re: [PATCH RFC 2/7] block: add helper function fetching gendisk from queue

From: Mike Snitzer <hidden>
Date: 2021-01-07 20:32:56
Also in: dm-devel, io-uring

On Wed, Dec 23 2020 at  6:26am -0500,
Jeffle Xu [off-list ref] 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@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@linux.alibaba.com>
Review-by: Mike Snitzer [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help