Re: About the request queue of block device

Jens Axboe (axboe@suse.de)
Wed, 9 Jan 2002 15:28:07 +0100


On Tue, Jan 08 2002, Michael Zhu wrote:
> Hi, Jens, thank you very much for you kindly reply.
> Your advice is very helpful to me. I've made some
> revisions according to your advice. The attachment
> contains some functions of mine. I don't know whether
> I am right. I've done some test, but failed.
>
> In your mail you said that I can replace floppy
> blk_dev
> make_request_fn with my own that does the encryption
> on write and stacks a new buffer head on top of the
> other for READ, defining my own b_end_io function for
> that to decrypt on READ end I/O. How can I stacks a
> new buffer head on top of the other for READ? Is it
> necessary? How to implement this? Please give me a
> hand on this. Thank you very much.

Yes it's necessary, you can't go fiddling with b_end_io b_private of a
buffer you don't own. See loop.c

> BTW, I've browsed the source code of __make_request()
> function in the ll_rw_blk.c file. Do I need to call
> the 'bh = create_bounce(rw, bh);' before I can access
> the bh->b_data? You know the buffer data may point

Inside make_request_fn, yes you need to bounce it yourself.

> into the high memory. My failure is because of this?

Probably not.

-- 
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/