Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2012 06:36:02 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, freebsd-arch@FreeBSD.org, Robert Millan <rmh@FreeBSD.org>
Subject:   Re: headers that use "struct bintime"
Message-ID:  <22720.1338186962@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 28 May 2012 04:00:59 %2B1000." <20120528023818.F2417@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys>, 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22720.1338186962>