Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-30 Thread Bart Van Assche
On Sun, 2017-05-28 at 10:37 +0200, Christoph Hellwig wrote: > Oh, and btw - for the mq case we don't want to use the function > pointer directly in the queue, but in blk_mq_ops, so that we have > all the mq methods in one place. Hello Christoph, Are you sure of this? All other function pointers

Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-28 Thread Bart Van Assche
On Sun, 2017-05-28 at 10:34 +0200, h...@lst.de wrote: > On Fri, May 26, 2017 at 11:56:30PM +, Bart Van Assche wrote: > > I have tried to move that call into blk_mq_alloc_request() but that > > resulted in a kernel oops during boot due to scsi_add_cmd_to_list() > > dereferencing

Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-28 Thread Christoph Hellwig
Oh, and btw - for the mq case we don't want to use the function pointer directly in the queue, but in blk_mq_ops, so that we have all the mq methods in one place.

Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-28 Thread h...@lst.de
On Fri, May 26, 2017 at 11:56:30PM +, Bart Van Assche wrote: > I have tried to move that call into blk_mq_alloc_request() but that > resulted in a kernel oops during boot due to scsi_add_cmd_to_list() > dereferencing scsi_cmnd.device and due to that pointer being invalid. > I think that

Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-26 Thread Bart Van Assche
On Fri, 2017-05-26 at 08:34 +0200, Christoph Hellwig wrote: > On Thu, May 25, 2017 at 11:43:16AM -0700, Bart Van Assche wrote: > > Several block drivers need to initialize the driver-private data > > after having called blk_get_request() and before .prep_rq_fn() is > > called, e.g. when submitting

Re: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-26 Thread Christoph Hellwig
On Thu, May 25, 2017 at 11:43:16AM -0700, Bart Van Assche wrote: > Several block drivers need to initialize the driver-private data > after having called blk_get_request() and before .prep_rq_fn() is > called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that > that initialization code has

[PATCH 08/19] block: Introduce request_queue.initialize_rq_fn()

2017-05-25 Thread Bart Van Assche
Several block drivers need to initialize the driver-private data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization code has to be repeated after every blk_get_request() call by adding a new