/*	@(#)volsys.h	13.1 (RC International) 91/02/02	*/

/**
 **  volsys.h
 **
 **  Volume management system calls.
 **
 **  This system call interface is a privileged call which is
 **  used by the volume management utilities.
 **/

/*
 * Volume management requests for "volsys" calls. 
 */

#define V_DSKOFL	0	/* put phy disk soft offline */
#define V_DSKONL	1	/* put phy disk soft online */
#define V_GETCFG  	2	/* get PU volmgmt config parameters */
#define V_SETCFG	3	/* set PU volmgmt config parameters */
#define V_SETLVE	4	/* set LV config parameters */
#define V_GETLVE	5	/* get LV config parameters */
#define V_PLEXADD 	6	/* add plex to logical volume */
#define V_PLEXDEL 	7	/* delete plex from logical volume */
#define V_SDDADD   	8	/* subdisk addition */
#define V_SDDDEL   	9	/* subdisk deletion */
#define V_SDDOFL   	10	/* put soft subdisk offline */
#define V_SDDONL   	11	/* put soft subdisk online */
#define V_LVEEXT	12	/* logical volume extension */ 
#define V_LVEFORGET  	13	/* forget about the logical volume */
#define V_LVEFIND  	14	/* find the logical volume */
#define V_LVEDESTROY  	15	/* destroy the logical volume */
#define V_LVERENAME  	16	/* rename the logical volume */
#define V_DISKSTATE	17	/* place the disk in the given state */
#define V_BACKUPLEX	18	/* make a plex a backup plex */
#define V_RESTORELV	19	/* restore logical volume from backup plex */
#define V_NEWVOLUME	20	/* make a backup plex a new volume */
#define V_FINDNEWVOLS	21	/* find new volumes (internal use ONLY) */
#define V_SDELHRD	22	/* Hard SD delete */
#define V_SDOFLHRD	23	/* Hard SD offline */
#define	V_SETFSUID	24	/* Set fsuid of volume */
#define	V_LVEDELETE	25	/* delete the logical volume */
#define	V_CTLRSTATE	26	/* change the controller to the given state */
#define	V_SDMOVE	27	/* transparently replace a subdisk */

/**
 ** Input argument data structures for "volsys" calls.
 **/

struct v_dskofl
{
    char	*v_dskpath;	/* (I) path of disk soft offline */
};

struct v_dskonl
{
    char	*v_dskpath;	/* (I) path of disk soft online */
};


struct v_setcfg
{
    /*  SET PU volmgmt config data. */
    bool_t	v_mnt_subset;	/* (I) default mounting subset LVs. */
    bool_t	v_mnt_incons;	/* (I) default mounting inconsistent LVs.*/
    u_short	v_pu_id;	/* (I) pu to set for */
    u_int	v_mnt_delay;	/* (I) default timer callout mount delays.*/
    u_int	v_rev_delay;	/* (I) default timer callout revive delays.*/
    u_int	v_rev_rate;	/* (I) delay after each revive I/O cycle. */
    u_int	v_rev_blksz;	/* (I) blocksize used by revive proc */
    u_int	v_rev_prcs;	/* (I) max concurrent revive proc */
};


struct v_getcfg
{
    /*  GET PU volmgmt config data. */
    bool_t	v_mnt_subset;	/* (O) default mounting subset LVs. */
    bool_t	v_mnt_incons;	/* (O) default mounting inconsistent LVs.*/
    u_short	v_pu_id;	/* (O) pu id gotten for */
    u_int	v_mnt_delay;	/* (O) default timer callout mount delays.*/
    u_int	v_rev_delay;	/* (O) default timer callout revive delays. */
    u_int	v_rev_rate;	/* (O) delay after each revive I/O cycle. */
    u_int	v_rev_blksz;	/* (O) blocksize used by revive proc */
    u_int	v_rev_prcs;	/* (O) max concurrent revive proc */
}; /* v_getcfg */



struct v_setlve
{
    /*  Change the settable options for a given logical volume. */
    char	*v_lvpath;	/*  (I) logical volume path */
    bool_t	v_mnt_subset;	/*  (I) mount subset LV */
    bool_t	v_mnt_incons;	/*  (I) mount inconsistent LV.*/
    bool_t	v_auto_mnt_fs;	/*  (I) fsys auto mounted */
    bool_t	v_fs_umnt;	/*  (I) fsys is umounted */
    u_short	v_lvc_1;	/*  (I) PU no for LVC choice #1 */
    u_short	v_lvc_2;	/*  (I) PU no for LVC choice #2 */
};


struct v_getlve
{
    /*  Get the state of the settable options for a given logical volume. */
    char	*v_lvpath;	/*  (I) logical volume path */
    bool_t	v_mnt_subset;	/*  (O) mount subset LV */
    bool_t	v_mnt_incons;	/*  (O) mount inconsistent LV.*/
    bool_t	v_auto_mnt_fs;	/*  (O) fsys auto mounted */
    bool_t	v_fs_umnt;	/*  (O) fsys is umounted */
    u_short	v_lvc_1;	/*  (O) PU no for LVC choice #1 */
    u_short	v_lvc_2;	/*  (O) PU no for LVC choice #2 */
};


struct v_plexadd
{
    UID_T	*v_plexuids;	/* (I) ptr to list of SD uids in ascending 
				 *     seq no order describing the plex. 
				 *     This list is terminated with a 
				 *     (uidzero) entry. The (plex_uids) 
				 *     buffer must be at least 
				 *     (SD_PER_LOG_DSK+1) uids in length. */
    UID_T	v_lvuid;	/* (I) uid of the target LV */
};

struct v_plexdel
{
    UID_T	*v_plexuids;	/* (I) ptr to list of SD uids in ascending 
				 *     seq no order describing the plex. 
				 *     This list is terminated with a 
				 *     (uidzero) entry.  The (plex_uids) 
				 *     buffer must be at least 
				 *     (SD_PER_LOG_DSK+1) uids in length. */
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_sddadd
{
    UID_T	v_lvuid;	/*  (I) uid of target LV */
    UID_T	v_sduid;	/*  (I) uid of added SD */
    u_short	v_seqno;	/*  (I) seq number added to this SD */
};

struct v_sdddel
{
    UID_T	v_lvuid;	/*  (I) uid of target LV. */
    UID_T	v_sduid;	/*  (I) uid of added SD. */
};

struct v_sddofl
{
    UID_T	v_lvuid;	/*  (I) uid of target LV. */
    UID_T	v_sduid;	/*  (I) uid of added SD. */
};

struct v_sddonl
{
    UID_T	v_lvuid;	/*  (I) uid of target LV */
    UID_T	v_sduid;	/*  (I) uid of added SD. */
};

struct v_lveext
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
    UID_T	*v_sdguids;	/* (I) ptr to list of SD uids
				 *     describing the subdisk group.
				 *     This list is terminated with a 
				 *     (uidzero) entry.  The (sdguids) 
				 *     buffer must be at least 
				 *     (MAX_PLEX+1) uids in length. */
};

struct v_lveforget
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_lvefind
{
    char	*v_lvlabel;	/* (I) logical volume label */
};

struct v_lvedestroy
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_lverename
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
    char	*v_lvlabel;	/* (I) new logical volume label */
};

struct v_diskstate
{
    char	*v_dskpath;	/* (I) path of disk to test */
    int		v_state;	/* (I) (CONF_XXXX) see <rte/config.h> */
};

struct v_backuplex
{
    UID_T	*v_plexuids;	/* (I) ptr to list of SD uids in ascending 
				 *     seq no order describing the plex. 
				 *     This list is terminated with a 
				 *     (uidzero) entry.  The (plex_uids) 
				 *     buffer must be at least 
				 *     (SD_PER_LOG_DSK+1) uids in length. */
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_restorelv
{
    UID_T	*v_plexuids;	/* (I) ptr to list of SD uids in ascending 
				 *     seq no order describing the plex. 
				 *     This list is terminated with a 
				 *     (uidzero) entry.  The (plex_uids) 
				 *     buffer must be at least 
				 *     (SD_PER_LOG_DSK+1) uids in length. */
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_newvolume
{
    UID_T	v_lvuid;	/* (I) uid of target LV  */
    UID_T	v_sduid;	/* (I) uid of target subdisk */ 
};

struct v_findnewvols
{
    char	*v_dskpath;	/* (I) path of disk to find new volumes on */
};

struct v_setfsuid
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
    UID_T	v_fsuid;	/* (I) new fs uid for LV */
};

struct v_lvedelete
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
};

struct v_ctlrstate
{
    char	*v_dskpath;	/* (I) path of controller to fail/online */
    int		v_state;	/* (I) (CONF_XXXX) see <rte/config.h> */
};

struct v_sdmove
{
    UID_T	v_lvuid;	/* (I) uid of target LV */
    UID_T	v_sduid;	/* (I) uid of SD in LV to be replaced */
    UID_T	v_newsduid;	/* (I) uid of new SD */
};
