Re: [PATCH] size-in-bytes

From: Andries.Brouwer@cwi.nl
Date: Thu Feb 21 2002 - 04:54:44 EST


    From: Benjamin LaHaise <bcrl@redhat.com>

    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.

Andries

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



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:30 EST