From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 25 23:17:57 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F17BF106566B; Fri, 25 Mar 2011 23:17:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AE8F08FC16; Fri, 25 Mar 2011 23:17:57 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63] (may be forged)) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p2PNCTT4053922; Fri, 25 Mar 2011 17:12:29 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Fri, 25 Mar 2011 15:50:54 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20110325002115.GA323@freebsd.org> <20110325015508.GA14565@freebsd.org> <20110325024658.GA19544@freebsd.org> <336A9ACD-29BF-41C9-BC25-917CC1E4587D@bsdimp.com> <20110325195325.GA69264@freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.1082) Cc: Alexander Best , freebsd-hackers@FreeBSD.org Subject: Re: Switching to [KMGTPE]i prefixes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2011 23:17:58 -0000 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