vxiod(7)


vxiod - control Volume Manager I/O daemon process

Description

The vxiod device is used to control the number of volume I/O daemon active on the system. A process context is necessary to implement the plex consistency recovery and writeback error handling policies for multi-plex volumes, and for continuing normal I/O after a log write if the volume has logging enabled. It is also required for the plex recovery performed with a mirrored volume in the read/writeback mode.

There are three aspects of the I/O daemons operations: general I/O, error handling, and log handling. These will be discussed seperately.

I/O handling is achieved by an ioctl command that doesn't return, but instead calls the vxiod routine to wait for errors or I/O requests and process them. When an error occurs, if there are no I/O daemons active, then the I/O simply turns into a failure on that plex. If a general I/O request is queued up when no daemons exist, then the I/O will hang forever until a daemon process is created. If I/O daemons are active, then the I/O is put on a work queue and the daemons get a wakeup. A daemon takes an error request and tries to read other plexes until a read succeeds or all plexes have been tried. Then, if the writeback facility is enabled, the daemon tries to write the good data to each plex that failed on the read. If the write is successful, the read error is nullified. An I/O request is handled in a similar manner.

Logging is handled in a similiar manner. An ioctl command, which does not return, is issued to create a daemon for each volume which has logging enabled. This daemon monitors two queues: one queue of I/O which was started while the log was busy (the ``log'' queue), and another queue of requests which have been logged and now need to be started (the ``ready'' queue). I/O requests are taken from the log queue when the log is no longer busy, and another log write is started. Completion of a log write results in all I/O requests which have just been logged being placed on the I/O daemon's ready queue, where they are immediately started.

One mechanism finds out how many I/O error daemons are running, and another mechanism allows a process to become an I/O daemon. Before a process becomes an I/O daemon, it should close all open files and detach from the controlling tty. An I/O or logging daemon cannot be killed except through an explicit ioctl.

Ioctls

The ioctls supported by the vxiod device are described later in this section. The format for calling each ioctl command is

	#include <sys/types.h>
	#include <sys/vol.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 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_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 the volinfo structure are:

	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 */

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.

VOL_IO_DAEMON_CNT
This ioctl returns the number of I/O daemons currently running for the purpose of error handling. The value of arg is undefined and should be NULL.

VOL_IO_DAEMON
This command turns the process into an I/O daemon, for the purpose of error handling. This process is killed on receipt of a non-ignored signal.

VOL_IO_DAEMON_KILL
This command causes the passed argument to be the maximum number of active I/O daemon processes to be left alive. All others will be killed.

VOL_LOG_IO_DAEMON
This command creates an I/O daemon for the purpose of log handling for the indicated volume. The argument is the device number (as returned by stat) of the volume for which logging is handled. Only one such process can exist for each volume. A logging daemon can be created for a volume which does not yet exist, or for which logging is not used. In this case, the logging daemon is unused until the volume is created or logging is enabled.

This command is killed when the logging daemon is stopped explicitly by the VOL_LOGIOD_KILL ioctl.

VOL_LOGIOD_WAIT
Sleeps until a logging daemon exists for a volume, then returns 0. The argument is the device number of the volume. The volume does not need to exist yet. This ioctl allows the parent of a caller to VOL_LOG_IO_DAEMON to wait until the logging daemon is known to exist. This ioctl is interruptible.

VOL_LOGIOD_KILL
Causes the logging daemon for a volume to exit or return (see VOL_LOG_IO_DAEMON). The argument is the device number of the volume. This ioctl does not return until the logging daemon has exited, or until it is interrupted by a signal.

VOL_LOGIOD_CHECK
Returns a positive number if a volume has a logging daemon running against it; otherwise, returns 0. The argument is the device number of the volume.

Files

/dev/vxiod

References

vxinfo(1M), vxiod(1M), ioctl(2), vxconfig(7), vxtrace(7)



© 1997 The Santa Cruz Operation, Inc. All rights reserved.