From owner-freebsd-arch@FreeBSD.ORG Mon May 28 06:36:12 2012 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83699106564A; Mon, 28 May 2012 06:36:12 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 3E6DB8FC0A; Mon, 28 May 2012 06:36:12 +0000 (UTC) Received: from critter.freebsd.dk (critter-phk.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id E37A0139C3; Mon, 28 May 2012 06:36:04 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id q4S6a2i8022721; Mon, 28 May 2012 06:36:03 GMT (envelope-from phk@phk.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 28 May 2012 04:00:59 +1000." <20120528023818.F2417@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 28 May 2012 06:36:02 +0000 Message-ID: <22720.1338186962@critter.freebsd.dk> Cc: Konstantin Belousov , freebsd-arch@FreeBSD.org, Robert Millan Subject: Re: headers that use "struct bintime" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 06:36:12 -0000 In message <20120528023818.F2417@besplex.bde.org>, Bruce Evans writes: >devstat has silly APIs, with long double values (despite needing the >range and precision of long doubles over doubles less than most things) >and bintimes (despite needing the precision of bintimes over less than >most things), but is well established so is hard to fix now. I take it you meant to write: devstat wisely chose sufficiently powerful data types to cover a significant of stretch of future, rather than fall in the all too common trap of skimping on data types for the sake of a few bytes ? >Headers with softcs in them >never belonged in , and softcs never belonged in public APIs, Well, that's pretty much how ioctls worked on very early versions of Unix, but I agree with you that it was architecturally wrong. >I wonder why scsi is still doing so much with devstat. For disks, >devstat handling mostly moved into geom. Mainly because SCSI also does tapes, and non-GEOM operations, such as formatting, on disks. I should have severed that link when I did GEOM, splitting devicestat into geomstat and camstat. Doing so now would still be a good idea. >I think libdevstat >just uses a sysctl that converts kernel struct devicestats into >userland struct devstat, so userland should never see the former. It mmaps /dev/devstat, so it is slightly more tangled. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.