# Re: \[PATCH 4/5\] block: move the bdi from the request\_queue to the gendisk

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2021-08-10 16:44:16 
- List: cgroups
- Page: https://ratatoskr.run/cgroups/2021/08/211980
- Thread: https://ratatoskr.run/linux-block/2021/08/211860/t.md

```text
On Mon, Aug 09, 2021 at 05:47:28PM +0200, Jan Kara wrote:
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index 2c4ac51e54eb..d2725f94491d 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -525,7 +525,7 @@ void blk_mq_free_request(struct request *rq)
> >  		__blk_mq_dec_active_requests(hctx);
> >  
> >  	if (unlikely(laptop_mode && !blk_rq_is_passthrough(rq)))
> > -		laptop_io_completion(q->backing_dev_info);
> > +		laptop_io_completion(queue_to_disk(q)->bdi);
> > 
> 
> E.g. cannot this get called for a queue that is without a disk?

As Jens already explained we need the gendisk for non-passthrough
commands.  Same for the wbt case.
```
