volinfo(7) — Special Files
NAME
volinfo − Logical Storage Manager (LSM) general information device
DESCRIPTION
The volinfo device is used to gather performance statistics from the kernel for a supplied object. Statistics can be retrieved for volume, plex, subdisk, and disk media objects.
Statistics can also be cleared through this interface.
IOCTLS
The ioctl commands supported by the Logical Storage Manager statistics device interface are discussed in this section. The format for calling each ioctl command is as follows:
#include <sys/types.h>
#include <sys/voltrace.h>
struct tag arg;
int ioctl (int fd, int cmd, struct tag ∗arg);
The value of cmd is the ioctl command code, and arg is usually a pointer to a structure containing the arguments that need to be passed to the kernel.
The return value for all these ioctls, with some exceptions, is 0 if the command was successful, and −1 if it was rejected. If the return value is −1, then errno is set to indicate the cause of the error.
The following ioctl commands are supported:
GET_DAEMON
This ioctl returns the pid of the process with the volconfig device open, or 0 if the volconfig device is closed. The value of arg is undefined and should be NULL.
GET_VOLINFO
This command accepts a pointer to a volinfo structure as an argument. It fills in the volinfo structure with the corresponding values from the kernel. The members of a volinfo structure are shown below:
long version; /∗ kernel version number ∗/
long voldinfo_sz; /∗ size of voldinfo area ∗/
major_t volbmajor; /∗ volume blk dev major number ∗/
major_t volcmajor; /∗ volume char dev major number ∗/
major_t plexmajor; /∗ plex device major number ∗/
long maxvol; /∗ max # of volumes supported ∗/
long maxplex; /∗ max # of associated plexes ∗/
long plexnum; /∗ max plexes per volume ∗/
long sdnum; /∗ max subdisks per plex ∗/
long max_ioctl; /∗ max size of ioctl data ∗/
long max_specio; /∗ max size of ioctl I/O op ∗/
long max_io; /∗ max size of I/O operation ∗/
long max_ilocksleep; /∗ max sleeps on ilock ∗/
long dflt_iodelay; /∗ default I/O delay for utils ∗/
long max_freebuf; /∗ max number of volbufs to keep ∗/
long max_freevcb; /∗ max number of volcbs to keep ∗/
long max_parallelio; /∗ max # voldios allowed ∗/
VOL_GET_STATS
This command accepts a pointer to a vol_getstat structure as an argument and fills in the performance statistics for the object whose ID appears in the structure.
The members of the vol_getstat structure are:
volrid_t s_dg_import_id; /∗ disk group ID ∗/
volrid_t s_rid; /∗ object ID ∗/
union vol_stats ∗s_stats; /∗ stat buffer ∗/
The s_dg_import_id field identifies the disk group in which the s_rid object exists. The s_rid value can be obtained from either a volrec, plexrec, sdrec, or dmrec structure.
The import ID is required so as to avoid ID number collisions between disk groups if using just the object’s record ID. The vol_stats union is defined in the voltrace.h header file.
VOL_CLR_STATS
This command accepts a pointer to a vol_getstat structure as an argument and will clear the kernel statistics for the identified object.
ERRORS
The following errors are returned by the VOL_GET_STATS and VOL_CLR_STATS ioctls:
EFAULTA pointer passed to the kernel was invalid, causing a bad memory reference.
ENOENTThe supplied s_dg_import_id does not match any existing imported disk groups or the supplied s_rid object could not be found.
FILES
/dev/volinfo
Logical Storage Manager info device