lkml.org 
[lkml]   [2002]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] size-in-bytes
On Mon, Feb 18, 2002 at 11:43:38PM +0100, Daniel Phillips wrote:
> We want to stay with the shift counts. They should be the primary currency
> of size measurement. You can add shift counts together and get nice, compact
> code, whereas with absolute size you often have to ugly things - e.g., it's a
> pain to divide by blocksize when you have it as an absolute number, it's easy
> when you have it as a shift.
>
> If you are going to the trouble of fixing this, please don't use absolute
> size as the primary measure, use a shift count.

Most of this is targetted at userland which needs byte counts (size in
sectors was a bug introduced after the original BLKGETSIZE64 went in).
Using the number of sectors in kernel is perhaps more efficient, but it
is a microoptimization that won't show up on any benchmarks.

-ben
-
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/

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