|
few problems in my driver
Hello
I am stuck with few problems in my device driver in linux.
1. Among other things in my make_request() function , I need to write a fixed sector of a partition with size 8K bytes ,
i have device number, size in bytes, new data to write and i have own buffer_head in one of my private structure.
i will use this buffer_head to write to a disk..saying this i need not use getblk(), get_unused_buffer() to retrive any free buffer_head because i have my own. How to do this. Any pointers, sample driver code, links will be greatly helpfull to me..
2. In my make_request(), i usually clone each incoming buffer_heads in to my private array of buffer_heads to submit this equest to low level driver say IDE,SCSI..etc. If incoming buffer_head request is so fast, i will exhaust my private array of buffer_heads. In this case what should i do.
I have tried following.
a. queue when i exhaust my private array,and sumit it again when i get free buffer_heads in b_end_io() context.
but it is bad to use generic_make_request() at b_end_io() context( because this is interrupt context).
b.since b_end_io context is an interreupt context, i tried using kernel_threads waking up it up when there are free buffer_head in my private array.
but this has very low performance and does not work properly.
Plese guide me in this regard. I am sorry if this is wrong place of my post.
-Kotresh.
|