public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* About the request queue of block device
@ 2002-01-07 21:37 Michael Zhu
  2002-01-08  7:15 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Zhu @ 2002-01-07 21:37 UTC (permalink / raw)
  To: linux-kernel

Hello, everyone, I have a question about the request
queue of block device.

I intercept the request function of floppy disk device
by changing the pointer, 
 "blk_dev[2].request_queue.request_fn", in my kernel
module. The following is the source code.

original_request_fn_proc =
blk_dev[2].request_queue.request_fn;
blk_dev[2].request_queue.request_fn =
my_request_fn_proc;

In my own my_request_fn_proc() I use the "req =
blkdev_entry_next_request(&rq->queue_head)" function
to get the pointer of the request structure. When
req->cmd is WRITE I encrypt all the b_data buffer of
the buffer header. Then I call the
original_request_fn_proc(). And it works. The data on
the floppy disk is some kind of cipher data. The
trouble is when the req->cmd is READ. I don't know
whether the b_data buffer contains the data read from
the floppy disk after I call the
original_request_fn_proc() function. When read a block
from the block device, where is the data is placed?

In my module I use the blkdev_next_request() function
to get the next request. When I want to do the same
thing to this next request, the Linux kernel
deadlocked. I must reboot the OS. What is wrong?

Any idea will be appreciated. Thanks in advance.

Michael


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-01-09 14:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-07 21:37 About the request queue of block device Michael Zhu
2002-01-08  7:15 ` Jens Axboe
2002-01-09  7:36   ` Michael Zhu
2002-01-09 14:28     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox