Re: sector size in block device drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sorry but my question it seems wsnt clear ...
as my ques was

suppose i have this function

blk_queue_hardsect_size(
request_queue_t *queue , unsigned short max );

or some other function takes sector as parameter
there in any of these functions
how do i decide that whether i should send number sectors in terms of 512 bytes
or in terms of my hardware size 2048 bytes ....

how do i know that in this function communication is between kernel to block layer
or from block layer to driver

as in book they just write this

"All request generated by kernel are multiple of
hardware sect size and properly aligned All the communication 
from block layer and driver is in 512 bytes"

as struct request req i get in request function ....
what should i assume of req->current_nr_sectors are they 512 byte sectors
or 2048 byte sectors 

pl clarify ....hope i m making sense..
 







On Sun, Feb 1, 2009 at 3:20 PM, nidhi mittal <nidhimittal19@xxxxxxxxx> wrote:
hello
i was writing my initial block device driver following LDD
but was totally confused on KERNEL SECTOR SIZE and hardware sector size issue they discussed in that .
 
they write sth like
if sector number passed between kernel and block layer it should be something and
if its passed between blocklayer and driver it should be something else.
 
means at different place some confusing note abt sector size
can someone clear it to me in simple 2-3 sentences
 
At what places , in which function i shd consider sending sector size with a thought that
at this place it understand sector= 512 bytes
and
At what places , in which function i shd consider sending sector size as my hardware sector size
in thinking that it understand 2048 bytes ...
 
and
most important
in book they write
 
blk_queue_hardsect_size(request_queue_t *queue , unsigned short max );
"All the communication from block layer and driver is in 512 bytes but all request generated by kernel are multiple of 
hardware sect size and properly aligned "
 
so i wanted to know where actually is block layer and where is driver  
where are they separated how do i know when i m going from block layer to driver ....
what i understand is ONLY user space and kernel space
 
it will be very kind if someone clears it to me.
thanks
Nidhi
 
 
Thanks & Regards
Nidhi



--
Thanks & Regards
Nidhi

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux