Block I/O sizes

From: Block Device
Date: Tue Oct 25 2005 - 04:46:30 EST


Hi,

I've added a jprobe to generic_make_request and am print(k)ing the
bio->bi_sector and
bio_sectors(bio) for every bio.

I expected that for every bio thus printed the bi_sector would be
in terms of sector size.
But this is apparently not the case.

When any fs i/o is done, the bi_sector value is in terms of fs
block size and not sector size (for the block device). When i perform
raw i/o to the device ( dd for eg ), bi_sector is in terms of sectors
and not fs blocks.

In both the cases though, bio_sectors(bio) returns the amount of
data written in sectors.

To me this is rather strange. Should it not be in terms of sector size always ?
Can someone please explain ?

Thanks
-BD
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/