Re: About block device request function.

From: Jens Axboe (axboe@suse.de)
Date: Fri Jan 11 2002 - 01:42:14 EST


On Thu, Jan 10 2002, Michael Zhu wrote:
> Hi, I have a question of the block device request
> function. I use the following sentences to change the
> request function of a block device.
>
> spin_lock_irq(&io_request_lock);
>
> original_make_request_fn =
> blk_dev[i].request_queue.make_request_fn;
>
> blk_dev[i].request_queue.make_request_fn =
> kti_make_request_fn;
>
> spin_unlock_irq(&io_request_lock);
>
> "i" is the major number of a block device.
>
> You know blk_dev[] is the global block device array.
> When I use those sentences to change the floppy block
> device's request function, it works. The major number
> of the floppy disk is 2. But when I use the same one
> to change the hard disk's request function, it doesn't
> work. I found that the
> blk_dev[3].request_queue.make_request_fn is NULL. Does
> that mean that the make_request_fn() of the hard disk
> is NULL. I can't believe it. Can anyone give me an
> answer?

Read drivers/block/ll_rw_blk.c:blk_get_queue() -- either a driver uses
the statically allocated per-major queue, or it provides its own and
defines a get_queue function to return it.

You are still heading in the wrong direction :/

-- 
Jens Axboe

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:34 EST