Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Mar 2011 15:50:54 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Xin LI <delphij@gmail.com>
Cc:        Alexander Best <arundel@FreeBSD.org>, freebsd-hackers@FreeBSD.org
Subject:   Re: Switching to [KMGTPE]i prefixes?
Message-ID:  <D29C3B5E-5BB1-40B5-ACE3-7F560DCAE86D@bsdimp.com>
In-Reply-To: <AANLkTinEcT__Wtc6LkSyqqMnQwuKVUbZC4dPZvZH_dSX@mail.gmail.com>
References:  <20110325002115.GA323@freebsd.org> <20110325015508.GA14565@freebsd.org> <20110325024658.GA19544@freebsd.org> <336A9ACD-29BF-41C9-BC25-917CC1E4587D@bsdimp.com> <20110325195325.GA69264@freebsd.org> <AANLkTinEcT__Wtc6LkSyqqMnQwuKVUbZC4dPZvZH_dSX@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mar 25, 2011, at 3:33 PM, Xin LI wrote:

> FYI I have a patch and I have incorporated some of Alexander's idea.
>=20
> Difference:
>=20
> - Use of both HN_DIVISOR_1000 and HN_IEC_PREFIXES triggers an
> assertion.  I think it doesn't make sense to return since this is an
> API violation and we should just tell the caller explicitly;
> - DIVISOR_1000 and !1000 cases use just same prefixes, so merge them
> while keeping divisor intact;
> - Make prefixes table consistently long.  I have no strong opinion on
> this one, though, it's just what my original version used and I can
> change it to the way Alexander did if there is an advantage of doing
> that way.

I did this in my first iteration, but switched to the array version =
after.  Either is good, honestly.

> (Note, it seems that we use HN_ prefix for both 'scale' and 'flags', I
> have sorted them by value but HN_IEC_PREFIXES should really belong to
> the flags group).


How did you guys deal with programs like df that now need to do special =
buffer size hacks to get consistent results?

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D29C3B5E-5BB1-40B5-ACE3-7F560DCAE86D>