Re: sector size in block device drivers

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

 



Hi Nidhi,

> i wanted to know where actually is block layer and where is driver
>where are they separated

As far as I know, the differentiation between file system
block size and device block size lies in the generic block layer.
Generic block layer knows all about, sectors, blocks, segments and
pages of data. Generally a block device always is a disk,
which work on sectors and the file system works on blocks.

If you insist on different layes and location of block layer
and block device driver, here is something that might
be helpful.

------------------------------------------
                       VFS                            <--------Common File Model
------------------------------------------
                   Disk Cache                      <--------Consists of pages
------------------------------------------
                  File System                       <------- We now
move into blocks
==============================
         GENERIC BLOCK LAYER            <-- Differentiates between fs block and
                                                                device
block [ Here your answer lies  :) ]
==============================
          I/O     SCHEDULERS                  <=== Scheduling of
requests, elevators used.
------------------------------------------
           Block Device Drivers                  <------just above
disks lies the block device driver

processes read write requests from its queue.
------------------------------------------
               Physical Disks
------------------------------------------


HTH



On Sun, Feb 1, 2009 at 8:01 PM, Sandeep K Sinha <sandeepksinha@xxxxxxxxx> wrote:
> Also, see this thread and the reply from Greg.
>
> http://mail.nl.linux.org/kernelnewbies/2009-01/msg00241.html
>
> Ccing Greg as well.
>
> HTH,
>
>
> 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
>
>
>
> --
> Regards,
> Sandeep.
>
>
>
>
>
>
> "To learn is to change. Education is a process that changes the learner."
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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