linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* blk_queue_hardsect_size 520-byte sector
@ 2008-06-06  4:58 Anil kumar
  2008-06-06  7:54 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Anil kumar @ 2008-06-06  4:58 UTC (permalink / raw)
  To: linux-kernel, linux-scsi

Hi,

Can I call blk_queue_hardsect_size in a driver and set it to 520-byte as hardware sector size. 
How does the kernel and block layers take the request, will it be in multiples of 520-bytes aligned or 512 bytes aligned?

Thanks for your help in advance.

with regards,
  Anil


      

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

* Re: blk_queue_hardsect_size 520-byte sector
  2008-06-06  4:58 blk_queue_hardsect_size 520-byte sector Anil kumar
@ 2008-06-06  7:54 ` Jens Axboe
  2008-06-06 10:18   ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2008-06-06  7:54 UTC (permalink / raw)
  To: Anil kumar; +Cc: linux-kernel, linux-scsi

On Thu, Jun 05 2008, Anil kumar wrote:
> Hi,
> 
> Can I call blk_queue_hardsect_size in a driver and set it to 520-byte
> as hardware sector size.  How does the kernel and block layers take
> the request, will it be in multiples of 520-bytes aligned or 512 bytes
> aligned?

No, Linux only supports power-of-2 hardware block sizes I'm afraid.

-- 
Jens Axboe


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

* Re: blk_queue_hardsect_size 520-byte sector
  2008-06-06  7:54 ` Jens Axboe
@ 2008-06-06 10:18   ` Alan Cox
  2008-06-06 10:36     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2008-06-06 10:18 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Anil kumar, linux-kernel, linux-scsi

On Fri, 6 Jun 2008 09:54:33 +0200
Jens Axboe <jens.axboe@oracle.com> wrote:

> On Thu, Jun 05 2008, Anil kumar wrote:
> > Hi,
> > 
> > Can I call blk_queue_hardsect_size in a driver and set it to 520-byte
> > as hardware sector size.  How does the kernel and block layers take
> > the request, will it be in multiples of 520-bytes aligned or 512 bytes
> > aligned?
> 
> No, Linux only supports power-of-2 hardware block sizes I'm afraid.

And only some of those - which is why we can't support CP/M disks and
also early smartmedia stuff (128/256 byte/sector)

If you are trying to deal with 520 byte blocks that are 512 bytes file
system data + 8 bytes of meta data then use 512 byte block sizes and put
the meta-data somewhere else or provide a different way to access it  -
eg ATA uses 512 byte sectors for normal ATA but the sg_io() ioctl path
allows the issuing of commands like READ_LONG for specific cases where
the additional meta data is needed.

Alan

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

* Re: blk_queue_hardsect_size 520-byte sector
  2008-06-06 10:18   ` Alan Cox
@ 2008-06-06 10:36     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2008-06-06 10:36 UTC (permalink / raw)
  To: Alan Cox; +Cc: Anil kumar, linux-kernel, linux-scsi

On Fri, Jun 06 2008, Alan Cox wrote:
> On Fri, 6 Jun 2008 09:54:33 +0200
> Jens Axboe <jens.axboe@oracle.com> wrote:
> 
> > On Thu, Jun 05 2008, Anil kumar wrote:
> > > Hi,
> > > 
> > > Can I call blk_queue_hardsect_size in a driver and set it to 520-byte
> > > as hardware sector size.  How does the kernel and block layers take
> > > the request, will it be in multiples of 520-bytes aligned or 512 bytes
> > > aligned?
> > 
> > No, Linux only supports power-of-2 hardware block sizes I'm afraid.
> 
> And only some of those - which is why we can't support CP/M disks and
> also early smartmedia stuff (128/256 byte/sector)

Right, should've made that clearer - Linux only really supports
power-of-2 hw block sizes, where the size is >= 512 and <=
PAGE_CACHE_SIZE.

-- 
Jens Axboe

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

end of thread, other threads:[~2008-06-06 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06  4:58 blk_queue_hardsect_size 520-byte sector Anil kumar
2008-06-06  7:54 ` Jens Axboe
2008-06-06 10:18   ` Alan Cox
2008-06-06 10:36     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).