[lkml]   [2002]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] size-in-bytes
    From: Benjamin LaHaise <>

Using the number of sectors in kernel is perhaps more efficient, but it
is a microoptimization that won't show up on any benchmarks.

Yes. Since we have to go to 64-bit anyway it is not more
space-efficient, but of course shifting over 3 positions
is slightly faster than shifting over 12 positions.
But as you say, timewise there is no measurable difference,
while the code becomes much simpler.

There is also the point that a block device need not have a size
that is an integral number of sectors. That is most obvious with
the loop device, but also occurs elsewhere.
The partition making ioctls (and the loop mount options) allow one
to give a starting offset in bytes.

Thus, there are applications where it is really useful to have
the precise size, rather than the approximate size in sectors.
Also nbd uses the size in bytes, while amiga uses 256-byte sectors.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.019 / U:5.552 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site