Subject: Re: nore on disk stats
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Perry E. Metzger <perry@piermont.com>
List: tech-kern
Date: 11/10/1995 09:12:10
Also BTW, I'm going to start working on the section 9 (kernel internal
documentation) man page section after the Wasabi Informatics CD
release (a couple of weeks after the 1.1 release). If you (and anyone
else adding interfaces or changing them) could document all the stuff
you are dealing with in man pages suitable for section 9, that would
make life much nicer...

Jason Thorpe writes:
> With a suggestion from cgd, I have a mechanism that should pretty 
> accurately calculate the amount of time a disk is busy, using 
> timestamps.  My design has changed a little to adapt to implementation 
> details, but is more-or-less the same.  In particular, functions were added:
> 
> 	struct disk *disk_getfirst __P((void));
> 		Returns first disk in disklist.
> 
> 	struct disk *disk_getnext __P((struct disk *));
> 		Returns next disk in disklist.
> 
> 	struct disk *disk_find __P((char *));
> 		Returns the disk strucure corresponding to the
> 		provided name (e.g. "sd0" or "ccd3"), or NULL if no
> 		match is found.
> 
> 	void disk_busy __P((struct disk *));
> 		Increments the busy count, sets starting timestamp if
> 		count moves from 0 to 1.
> 
> 	void disk_unbusy __P((struct disk *));
> 		Decrements busy count, and sets ending timestamp and
> 		increments total busy time if count drops to 0.