mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Block I/O sizes
@ 2005-10-25  9:43 Block Device
  2005-10-25 10:15 ` Fawad Lateef
  0 siblings, 1 reply; 3+ messages in thread
From: Block Device @ 2005-10-25  9:43 UTC (permalink / raw)
  To: Linux Kernel Mailing List

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

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

* Re: Block I/O sizes
  2005-10-25  9:43 Block I/O sizes Block Device
@ 2005-10-25 10:15 ` Fawad Lateef
       [not found]   ` <64c763540510250521yf5e1ac3g221f42ed658d1bf0@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Fawad Lateef @ 2005-10-25 10:15 UTC (permalink / raw)
  To: Block Device; +Cc: Linux Kernel Mailing List

On 10/25/05, Block Device <blockdevice@gmail.com> 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

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

* Re: Block I/O sizes
       [not found]   ` <64c763540510250521yf5e1ac3g221f42ed658d1bf0@mail.gmail.com>
@ 2005-10-25 14:12     ` Fawad Lateef
  0 siblings, 0 replies; 3+ messages in thread
From: Fawad Lateef @ 2005-10-25 14:12 UTC (permalink / raw)
  To: Block Device; +Cc: Linux Kernel Mailing List

On 10/25/05, Block Device <blockdevice@gmail.com> wrote:
>
> >On 10/25/05, Fawad Lateef <fawadlateef@gmail.com> wrote:
>>
> > So, I don't think bi_sector in some case contains block_nr or
> > sector_nr, rather it always keeps sector_nr (CMIIW)
>
> Thanks, I realized I was not checking it correctly. It is always in
> terms of sectors as you
> say.
>
> > And __please__ change your name from Block Device to your real name,
> > its annoying to see Block Device as a name of a person. :(
>
> But really, my real name is block device ... I cant help it ;) !
>

First do reply through reply_to_all, and Second is how your real name
is block device ? Are they really exists and known by your parents at
that time ? :S ;)


--
Fawad Lateef

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

end of thread, other threads:[~2005-10-25 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-25  9:43 Block I/O sizes Block Device
2005-10-25 10:15 ` Fawad Lateef
     [not found]   ` <64c763540510250521yf5e1ac3g221f42ed658d1bf0@mail.gmail.com>
2005-10-25 14:12     ` Fawad Lateef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®