From owner-freebsd-current@FreeBSD.ORG Thu Jan 6 19:55:33 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5E9E16A4CE; Thu, 6 Jan 2005 19:55:33 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DD4043D1F; Thu, 6 Jan 2005 19:55:33 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j06JvJcK027173; Thu, 6 Jan 2005 11:57:19 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j06JvJ39027172; Thu, 6 Jan 2005 11:57:19 -0800 Date: Thu, 6 Jan 2005 11:57:19 -0800 From: Brooks Davis To: Giorgos Keramidas Message-ID: <20050106195719.GB24896@odin.ac.hmc.edu> References: <20050106191201.GA30826@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <20050106191201.GA30826@gothmog.gr> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: freebsd-current@freebsd.org Subject: Re: human-readable swap partition sizes with pstat -sh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 19:55:33 -0000 --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 06, 2005 at 09:12:01PM +0200, Giorgos Keramidas wrote: > The following patch adds support for human-readable partition sizes in > pstat -s and swapinfo output, when the -h option is used: >=20 > gothmog:/d/src/usr.sbin/pstat$ ./pstat -s > Device 1K-blocks Used Avail Capacity > /dev/ad1s1b 5120000 12 5120000 0% >=20 > gothmog:/d/src/usr.sbin/pstat$ ./pstat -sh > Device 1K-blocks Used Avail Capacity > /dev/ad1s1b 5120000 12K 4.9G 0% >=20 > Does anyone have comments or suggestions for further improvement? Look good in general. Does -kh make sense? I think so since it would force the blocks line, but I'm not 100% sure. On minor, mostly style nit is that while intmax_t is 64-bits, nothing requires that so you should probably have conver return an int64_t. I'd argue that we might want to replace the int64_t in humanize_number with intmax_t since that wouldn't change the ABI (or API due to implicit casts), but would mean we wouldn't have to add a humanize_number128 later if some architecture grows 128-bit ints for some reason or another. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFB3ZgeXY6L6fI4GtQRAoixAJoDZtmnNe/KCvfNkUp3sRkFPrPmUACgp5jr 2+M/dAC7S04dIMIrFBaetME= =PA3X -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz--