Hi Pete,
>
> Where is 512 enforced? How do you know it is exactly 512? Do all
> FSes support O_DIRECT at a 512-byte granularity? How can you detect
> this at runtime?
All disk FS'es that support direct I/O in 2.6 kernels (xfs, jfs, ext2,
ext3, reiserfs) call into blockdev_direct_IO(),__blockdev_direct_IO()
which does
>>
if (bdev)
bdev_blkbits = blksize_bits(bdev_hardsect_size(bdev));
if (offset & blocksize_mask) {
if (bdev)
blkbits = bdev_blkbits;
blocksize_mask = (1 << blkbits) - 1;
if (offset & blocksize_mask)
goto out;
}
>>
bdev_hardsect_size() usually returns 512 unless the block device request
queue overrides hardsect_size and even if they do it is usually larger
than 512.
blk_queue_hardsect_size() sets the minimum block device sector size of the
HW without reverting to read/modify/writes internally.
So all these FS'es ought to support granularity at a 512 byte granularity
on most sane disks/storage HW.
Thanks,
Murali
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers