Re: Block I/O sizes

From: Fawad Lateef
Date: Tue Oct 25 2005 - 05:15:21 EST


On 10/25/05, Block Device <blockdevice@xxxxxxxxx> wrote:
> 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 ?
>

bio_sectors is a macro which calculates nr_sectors from the bi_size
field, and as far as bi_sector is concerned, I always considered and
used as a sector (in terms of sector size) in my block-device drivers
whether the user is performing dd or anything else. And you can also
see ll_rw_blk.c in function __make_request its considering
bio->bi_sector as sector like this:

sector_t sector;
sector = bio->bi_sector;
nr_sectors = bio_sectors(bio);

So, I don't think bi_sector in some case contains block_nr or
sector_nr, rather it always keeps sector_nr (CMIIW)


And __please__ change your name from Block Device to your real name,
its annoying to see Block Device as a name of a person. :(


--
Fawad Lateef
-
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/