1*7836SJohn.Forte@Sun.COM /* 2*7836SJohn.Forte@Sun.COM * CDDL HEADER START 3*7836SJohn.Forte@Sun.COM * 4*7836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 5*7836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 6*7836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 7*7836SJohn.Forte@Sun.COM * 8*7836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*7836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*7836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 11*7836SJohn.Forte@Sun.COM * and limitations under the License. 12*7836SJohn.Forte@Sun.COM * 13*7836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*7836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*7836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*7836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*7836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*7836SJohn.Forte@Sun.COM * 19*7836SJohn.Forte@Sun.COM * CDDL HEADER END 20*7836SJohn.Forte@Sun.COM */ 21*7836SJohn.Forte@Sun.COM /* 22*7836SJohn.Forte@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*7836SJohn.Forte@Sun.COM * Use is subject to license terms. 24*7836SJohn.Forte@Sun.COM */ 25*7836SJohn.Forte@Sun.COM 26*7836SJohn.Forte@Sun.COM #ifndef _DSW_H 27*7836SJohn.Forte@Sun.COM #define _DSW_H 28*7836SJohn.Forte@Sun.COM 29*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 30*7836SJohn.Forte@Sun.COM extern "C" { 31*7836SJohn.Forte@Sun.COM #endif 32*7836SJohn.Forte@Sun.COM 33*7836SJohn.Forte@Sun.COM /* 34*7836SJohn.Forte@Sun.COM * Miscellaneous defines 35*7836SJohn.Forte@Sun.COM */ 36*7836SJohn.Forte@Sun.COM 37*7836SJohn.Forte@Sun.COM #define DSW_BITS 8 /* # of bits in a byte */ 38*7836SJohn.Forte@Sun.COM #define DSW_SIZE 64 /* fba's in a DSW chunk */ 39*7836SJohn.Forte@Sun.COM 40*7836SJohn.Forte@Sun.COM 41*7836SJohn.Forte@Sun.COM /* 42*7836SJohn.Forte@Sun.COM * Ioctl definitions 43*7836SJohn.Forte@Sun.COM */ 44*7836SJohn.Forte@Sun.COM 45*7836SJohn.Forte@Sun.COM #define _D_(x) (('D'<<16)|('W'<<8)|(x)) 46*7836SJohn.Forte@Sun.COM 47*7836SJohn.Forte@Sun.COM #define DSWIOC_ENABLE _D_(1) /* Configure DSW pair */ 48*7836SJohn.Forte@Sun.COM #define DSWIOC_RESUME _D_(2) /* Resume a DSW pair */ 49*7836SJohn.Forte@Sun.COM #define DSWIOC_SUSPEND _D_(3) /* Suspend a DSW pair */ 50*7836SJohn.Forte@Sun.COM #define DSWIOC_COPY _D_(4) /* Copy DSW volume over its pair */ 51*7836SJohn.Forte@Sun.COM #define DSWIOC_BITMAP _D_(5) /* Get bitmap */ 52*7836SJohn.Forte@Sun.COM #define DSWIOC_STAT _D_(6) /* Get state of shadow */ 53*7836SJohn.Forte@Sun.COM #define DSWIOC_DISABLE _D_(7) /* Deconfigure DSW pair */ 54*7836SJohn.Forte@Sun.COM #define DSWIOC_SHUTDOWN _D_(8) /* Suspend all DSW pairs */ 55*7836SJohn.Forte@Sun.COM #define DSWIOC_ABORT _D_(9) /* Abort Copy of DSW pair */ 56*7836SJohn.Forte@Sun.COM #define DSWIOC_VERSION _D_(10) /* DataShadow version */ 57*7836SJohn.Forte@Sun.COM #define DSWIOC_RESET _D_(11) /* Reset DataShadow set */ 58*7836SJohn.Forte@Sun.COM #define DSWIOC_OFFLINE _D_(12) /* Offline volumes */ 59*7836SJohn.Forte@Sun.COM #define DSWIOC_WAIT _D_(13) /* Wait for copy to complete */ 60*7836SJohn.Forte@Sun.COM #define DSWIOC_LIST _D_(14) /* List current kernel shadow groups */ 61*7836SJohn.Forte@Sun.COM #define DSWIOC_ACOPY _D_(15) /* Copy DSW volumes over their pairs */ 62*7836SJohn.Forte@Sun.COM #define DSWIOC_EXPORT _D_(16) /* Export the shadow volume */ 63*7836SJohn.Forte@Sun.COM #define DSWIOC_IMPORT _D_(17) /* Import shadow volume */ 64*7836SJohn.Forte@Sun.COM #define DSWIOC_JOIN _D_(18) /* Rejoin previously exported shadow */ 65*7836SJohn.Forte@Sun.COM #define DSWIOC_COPYP _D_(19) /* Set and get copy parameters */ 66*7836SJohn.Forte@Sun.COM #define DSWIOC_OCREAT _D_(20) /* Create overflow volume */ 67*7836SJohn.Forte@Sun.COM #define DSWIOC_OATTACH _D_(21) /* Attach overflow volume */ 68*7836SJohn.Forte@Sun.COM #define DSWIOC_ODETACH _D_(22) /* Detach overflow volume */ 69*7836SJohn.Forte@Sun.COM #define DSWIOC_OLIST _D_(23) /* List overflow volumes */ 70*7836SJohn.Forte@Sun.COM #define DSWIOC_OSTAT _D_(24) /* Stat overflow volume */ 71*7836SJohn.Forte@Sun.COM #define DSWIOC_SBITSSET _D_(25) /* Get # of bits set in shadow bitmap */ 72*7836SJohn.Forte@Sun.COM #define DSWIOC_CBITSSET _D_(26) /* Get # of bits set in copy bitmap */ 73*7836SJohn.Forte@Sun.COM #define DSWIOC_LISTLEN _D_(27) /* length of DSWIOC_LIST data */ 74*7836SJohn.Forte@Sun.COM #define DSWIOC_OLISTLEN _D_(28) /* length of DSWIOC_OLIST data */ 75*7836SJohn.Forte@Sun.COM #define DSWIOC_SEGMENT _D_(29) /* Get segemented bitmaps */ 76*7836SJohn.Forte@Sun.COM #define DSWIOC_MOVEGRP _D_(30) /* Move set from one group to another */ 77*7836SJohn.Forte@Sun.COM #define DSWIOC_CLIST _D_(31) /* get list of resource groups */ 78*7836SJohn.Forte@Sun.COM #define DSWIOC_GLIST _D_(32) /* get list of groups */ 79*7836SJohn.Forte@Sun.COM #define DSWIOC_CHANGETAG _D_(33) /* change the cluster tag of a set */ 80*7836SJohn.Forte@Sun.COM #define DSWIOC_OSTAT2 _D_(34) /* Stat overflow volume enhanced */ 81*7836SJohn.Forte@Sun.COM 82*7836SJohn.Forte@Sun.COM /* 83*7836SJohn.Forte@Sun.COM * Config and status flags 84*7836SJohn.Forte@Sun.COM */ 85*7836SJohn.Forte@Sun.COM 86*7836SJohn.Forte@Sun.COM #define DSW_GOLDEN 0x0001 /* the set is independent */ 87*7836SJohn.Forte@Sun.COM 88*7836SJohn.Forte@Sun.COM #define DSW_COPYINGP 0x0100 /* Copy in progress */ 89*7836SJohn.Forte@Sun.COM #define DSW_COPYINGM 0x0200 /* Copying master to shadow */ 90*7836SJohn.Forte@Sun.COM #define DSW_COPYINGS 0x0400 /* Copying shadow to master */ 91*7836SJohn.Forte@Sun.COM #define DSW_COPYING 0x0600 /* Copying, may be in progress */ 92*7836SJohn.Forte@Sun.COM #define DSW_COPY_FLAGS 0x0700 /* Copy flags */ 93*7836SJohn.Forte@Sun.COM #define DSW_COPYINGX 0x0800 /* Copy exit requested */ 94*7836SJohn.Forte@Sun.COM #define DSW_OFFLINE 0xf000 /* An underlying volume offline */ 95*7836SJohn.Forte@Sun.COM #define DSW_BMPOFFLINE 0x1000 /* Bitmap volume offline */ 96*7836SJohn.Forte@Sun.COM #define DSW_SHDOFFLINE 0x2000 /* Shadow volume offline */ 97*7836SJohn.Forte@Sun.COM #define DSW_MSTOFFLINE 0x4000 /* Master volume offline */ 98*7836SJohn.Forte@Sun.COM #define DSW_OVROFFLINE 0x8000 /* Overflow volume offline */ 99*7836SJohn.Forte@Sun.COM #define DSW_TREEMAP 0x10000 /* Shadow volume accessed by an index */ 100*7836SJohn.Forte@Sun.COM #define DSW_OVERFLOW 0x20000 /* Shadow volume has overflowed */ 101*7836SJohn.Forte@Sun.COM #define DSW_SHDEXPORT 0x40000 /* Shadow volume has been exported */ 102*7836SJohn.Forte@Sun.COM #define DSW_SHDIMPORT 0x80000 /* Shadow volume has been imported */ 103*7836SJohn.Forte@Sun.COM #define DSW_VOVERFLOW 0x100000 /* Shadow volume using overflow vol */ 104*7836SJohn.Forte@Sun.COM #define DSW_HANGING 0x200000 /* Hanging master structure */ 105*7836SJohn.Forte@Sun.COM #define DSW_CFGOFFLINE 0x400000 /* config db is offline */ 106*7836SJohn.Forte@Sun.COM #define DSW_OVRHDRDRTY 0x800000 /* Overflow header dirty */ 107*7836SJohn.Forte@Sun.COM #define DSW_RESIZED 0x1000000 /* mst_size != shd_size */ 108*7836SJohn.Forte@Sun.COM #define DSW_FRECLAIM 0x2000000 /* force the reclaim of an ovr vol */ 109*7836SJohn.Forte@Sun.COM 110*7836SJohn.Forte@Sun.COM /* 111*7836SJohn.Forte@Sun.COM * used for SNMP trap only. 112*7836SJohn.Forte@Sun.COM * These flags help distinguish between enable and resume, 113*7836SJohn.Forte@Sun.COM * suspend and disable. 114*7836SJohn.Forte@Sun.COM * Note that DSW_HANGING is set for both suspend and disable 115*7836SJohn.Forte@Sun.COM */ 116*7836SJohn.Forte@Sun.COM #define DSW_SNMP_CLR 0 /* no flag is set */ 117*7836SJohn.Forte@Sun.COM #define DSW_SNMP_DISABLE 1 /* Set is disabled */ 118*7836SJohn.Forte@Sun.COM #define DSW_SNMP_SUSPEND 2 /* Set is suspended */ 119*7836SJohn.Forte@Sun.COM #define DSW_SNMP_ENABLE 3 /* Set is enabled */ 120*7836SJohn.Forte@Sun.COM #define DSW_SNMP_RESUME 4 /* Set is resumed */ 121*7836SJohn.Forte@Sun.COM #define DSW_SNMP_OVER_ATTACH 5 /* overflow attached */ 122*7836SJohn.Forte@Sun.COM #define DSW_SNMP_OVER_DETACH 6 /* overflow detached */ 123*7836SJohn.Forte@Sun.COM #define DSW_SNMP_UPDATE 7 /* update operation */ 124*7836SJohn.Forte@Sun.COM #define DSW_SNMP_COPIED 8 /* copy operation */ 125*7836SJohn.Forte@Sun.COM 126*7836SJohn.Forte@Sun.COM /* Overflow volume flags */ 127*7836SJohn.Forte@Sun.COM #define IIO_OFFLINE 0x0001 /* Volume is offline */ 128*7836SJohn.Forte@Sun.COM #define IIO_HDR_WRTN 0x0002 /* Header written */ 129*7836SJohn.Forte@Sun.COM #define IIO_CNTR_INVLD 0x0004 /* Overflow counters invalid */ 130*7836SJohn.Forte@Sun.COM #define IIO_VOL_UPDATE 0x0008 /* Performing group update */ 131*7836SJohn.Forte@Sun.COM 132*7836SJohn.Forte@Sun.COM #define DSW_NAMELEN 64 /* NSC_MAXPATH - don't change without */ 133*7836SJohn.Forte@Sun.COM /* amending header version number */ 134*7836SJohn.Forte@Sun.COM 135*7836SJohn.Forte@Sun.COM #define DSWDEV "/dev/ii" 136*7836SJohn.Forte@Sun.COM #define II_IMPORTED_SHADOW "<imported_shadow>" 137*7836SJohn.Forte@Sun.COM 138*7836SJohn.Forte@Sun.COM /* 139*7836SJohn.Forte@Sun.COM * Configuration parameter defines 140*7836SJohn.Forte@Sun.COM * ii_bitmap, ii_throttle_unit, ii_throttle_delay 141*7836SJohn.Forte@Sun.COM */ 142*7836SJohn.Forte@Sun.COM #define II_KMEM 0 /* Load/store on resume/suspend, in memory */ 143*7836SJohn.Forte@Sun.COM #define II_WTHRU 1 /* Read/write bitmap thru to bitmap volume */ 144*7836SJohn.Forte@Sun.COM #define II_FWC 2 /* Read/write bitmap to FWC, else WTHRU */ 145*7836SJohn.Forte@Sun.COM 146*7836SJohn.Forte@Sun.COM #define MIN_THROTTLE_UNIT 100 /* Min. number of units to transfer */ 147*7836SJohn.Forte@Sun.COM #define MAX_THROTTLE_UNIT 60000 /* Max. number of units to transfer */ 148*7836SJohn.Forte@Sun.COM #define MIN_THROTTLE_DELAY 2 /* Min. delay between unit transfer */ 149*7836SJohn.Forte@Sun.COM #define MAX_THROTTLE_DELAY 10000 /* Max. delay between unit transfer */ 150*7836SJohn.Forte@Sun.COM 151*7836SJohn.Forte@Sun.COM /* 152*7836SJohn.Forte@Sun.COM * DSW user config structure 153*7836SJohn.Forte@Sun.COM */ 154*7836SJohn.Forte@Sun.COM 155*7836SJohn.Forte@Sun.COM typedef struct dsw_config_s { 156*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 157*7836SJohn.Forte@Sun.COM char master_vol[DSW_NAMELEN]; 158*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 159*7836SJohn.Forte@Sun.COM char bitmap_vol[DSW_NAMELEN]; 160*7836SJohn.Forte@Sun.COM char cluster_tag[DSW_NAMELEN]; 161*7836SJohn.Forte@Sun.COM char group_name[DSW_NAMELEN]; 162*7836SJohn.Forte@Sun.COM int flag; 163*7836SJohn.Forte@Sun.COM } dsw_config_t; 164*7836SJohn.Forte@Sun.COM 165*7836SJohn.Forte@Sun.COM /* 166*7836SJohn.Forte@Sun.COM * DSW segmented bitmap I/O structure 167*7836SJohn.Forte@Sun.COM */ 168*7836SJohn.Forte@Sun.COM typedef struct dsw_segment_s { 169*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 170*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 171*7836SJohn.Forte@Sun.COM unsigned seg_number; /* 32KB Segment number to start at */ 172*7836SJohn.Forte@Sun.COM unsigned char *shd_bitmap; /* pointer to shadow bitmap */ 173*7836SJohn.Forte@Sun.COM int shd_size; /* size of shadow bitmap */ 174*7836SJohn.Forte@Sun.COM unsigned char *cpy_bitmap; /* pointer to copy bitmap */ 175*7836SJohn.Forte@Sun.COM int cpy_size; /* size of copy bitmap */ 176*7836SJohn.Forte@Sun.COM unsigned char *idx_bitmap; /* pointer to index table */ 177*7836SJohn.Forte@Sun.COM int idx_size; /* size of index table */ 178*7836SJohn.Forte@Sun.COM } dsw_segment_t; 179*7836SJohn.Forte@Sun.COM 180*7836SJohn.Forte@Sun.COM /* 181*7836SJohn.Forte@Sun.COM * DSW user bitmap structure 182*7836SJohn.Forte@Sun.COM */ 183*7836SJohn.Forte@Sun.COM 184*7836SJohn.Forte@Sun.COM typedef struct dsw_bitmap_s { 185*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 186*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 187*7836SJohn.Forte@Sun.COM unsigned char *shd_bitmap; /* pointer to shadow bitmap */ 188*7836SJohn.Forte@Sun.COM uint64_t shd_size; /* size of shadow bitmap */ 189*7836SJohn.Forte@Sun.COM uint64_t copy_size; /* size of copy bitmap */ 190*7836SJohn.Forte@Sun.COM unsigned char *copy_bitmap; /* pointer to copy bitmap */ 191*7836SJohn.Forte@Sun.COM } dsw_bitmap_t; 192*7836SJohn.Forte@Sun.COM 193*7836SJohn.Forte@Sun.COM 194*7836SJohn.Forte@Sun.COM /* 195*7836SJohn.Forte@Sun.COM * DSW general ioctl structure 196*7836SJohn.Forte@Sun.COM */ 197*7836SJohn.Forte@Sun.COM 198*7836SJohn.Forte@Sun.COM typedef struct dsw_ioctl_s { 199*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 200*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 201*7836SJohn.Forte@Sun.COM int flags; 202*7836SJohn.Forte@Sun.COM pid_t pid; 203*7836SJohn.Forte@Sun.COM } dsw_ioctl_t; 204*7836SJohn.Forte@Sun.COM 205*7836SJohn.Forte@Sun.COM 206*7836SJohn.Forte@Sun.COM /* 207*7836SJohn.Forte@Sun.COM * DSW general atomic ioctl structure operating on several Image sets 208*7836SJohn.Forte@Sun.COM */ 209*7836SJohn.Forte@Sun.COM 210*7836SJohn.Forte@Sun.COM typedef struct dsw_aioctl_s { 211*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 212*7836SJohn.Forte@Sun.COM int flags; 213*7836SJohn.Forte@Sun.COM int count; 214*7836SJohn.Forte@Sun.COM pid_t pid; 215*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; /* start of list of image sets */ 216*7836SJohn.Forte@Sun.COM } dsw_aioctl_t; 217*7836SJohn.Forte@Sun.COM 218*7836SJohn.Forte@Sun.COM 219*7836SJohn.Forte@Sun.COM /* 220*7836SJohn.Forte@Sun.COM * DSW stat ioctl structure 221*7836SJohn.Forte@Sun.COM */ 222*7836SJohn.Forte@Sun.COM 223*7836SJohn.Forte@Sun.COM typedef struct dsw_stat_s { 224*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 225*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 226*7836SJohn.Forte@Sun.COM int stat; 227*7836SJohn.Forte@Sun.COM uint64_t size; 228*7836SJohn.Forte@Sun.COM char overflow_vol[DSW_NAMELEN]; 229*7836SJohn.Forte@Sun.COM uint64_t shdsize; 230*7836SJohn.Forte@Sun.COM uint64_t shdused; 231*7836SJohn.Forte@Sun.COM char group_name[DSW_NAMELEN]; 232*7836SJohn.Forte@Sun.COM char cluster_tag[DSW_NAMELEN]; 233*7836SJohn.Forte@Sun.COM uint64_t mtime; 234*7836SJohn.Forte@Sun.COM } dsw_stat_t; 235*7836SJohn.Forte@Sun.COM 236*7836SJohn.Forte@Sun.COM 237*7836SJohn.Forte@Sun.COM /* 238*7836SJohn.Forte@Sun.COM * DSW version ioctl structure 239*7836SJohn.Forte@Sun.COM */ 240*7836SJohn.Forte@Sun.COM 241*7836SJohn.Forte@Sun.COM typedef struct dsw_version_s { 242*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 243*7836SJohn.Forte@Sun.COM int major; /* Major release number */ 244*7836SJohn.Forte@Sun.COM int minor; /* Minor release number */ 245*7836SJohn.Forte@Sun.COM int micro; /* Micro release number */ 246*7836SJohn.Forte@Sun.COM int baseline; /* Baseline revision number */ 247*7836SJohn.Forte@Sun.COM } dsw_version_t; 248*7836SJohn.Forte@Sun.COM 249*7836SJohn.Forte@Sun.COM /* 250*7836SJohn.Forte@Sun.COM * DSW get bits set in bitmap structure 251*7836SJohn.Forte@Sun.COM */ 252*7836SJohn.Forte@Sun.COM 253*7836SJohn.Forte@Sun.COM typedef struct dsw_bitsset_s { 254*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 255*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 256*7836SJohn.Forte@Sun.COM uint64_t tot_size; /* total number of bits in map */ 257*7836SJohn.Forte@Sun.COM uint64_t tot_set; /* number of bitmap bits set */ 258*7836SJohn.Forte@Sun.COM } dsw_bitsset_t; 259*7836SJohn.Forte@Sun.COM 260*7836SJohn.Forte@Sun.COM 261*7836SJohn.Forte@Sun.COM /* 262*7836SJohn.Forte@Sun.COM * DSW list ioctl structure 263*7836SJohn.Forte@Sun.COM */ 264*7836SJohn.Forte@Sun.COM 265*7836SJohn.Forte@Sun.COM typedef struct dsw_list_s { 266*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 267*7836SJohn.Forte@Sun.COM int list_size; /* number of elements in list */ 268*7836SJohn.Forte@Sun.COM int list_used; /* number of elements returned */ 269*7836SJohn.Forte@Sun.COM dsw_config_t *list; 270*7836SJohn.Forte@Sun.COM } dsw_list_t; 271*7836SJohn.Forte@Sun.COM 272*7836SJohn.Forte@Sun.COM /* 273*7836SJohn.Forte@Sun.COM * DSW copy parameter structure 274*7836SJohn.Forte@Sun.COM */ 275*7836SJohn.Forte@Sun.COM 276*7836SJohn.Forte@Sun.COM typedef struct dsw_copyp_s { 277*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 278*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 279*7836SJohn.Forte@Sun.COM int copy_unit; 280*7836SJohn.Forte@Sun.COM int copy_delay; 281*7836SJohn.Forte@Sun.COM } dsw_copyp_t; 282*7836SJohn.Forte@Sun.COM 283*7836SJohn.Forte@Sun.COM /* 284*7836SJohn.Forte@Sun.COM * DSW ostat ioctl structure 285*7836SJohn.Forte@Sun.COM */ 286*7836SJohn.Forte@Sun.COM 287*7836SJohn.Forte@Sun.COM typedef struct dsw_ostat_s { 288*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 289*7836SJohn.Forte@Sun.COM char overflow_vol[DSW_NAMELEN]; 290*7836SJohn.Forte@Sun.COM int drefcnt; 291*7836SJohn.Forte@Sun.COM uint64_t used; 292*7836SJohn.Forte@Sun.COM uint64_t unused; 293*7836SJohn.Forte@Sun.COM uint64_t nchunks; 294*7836SJohn.Forte@Sun.COM int crefcnt; 295*7836SJohn.Forte@Sun.COM int flags; 296*7836SJohn.Forte@Sun.COM int hversion; 297*7836SJohn.Forte@Sun.COM int hmagic; 298*7836SJohn.Forte@Sun.COM } dsw_ostat_t; 299*7836SJohn.Forte@Sun.COM 300*7836SJohn.Forte@Sun.COM /* 301*7836SJohn.Forte@Sun.COM * DSW move group structure 302*7836SJohn.Forte@Sun.COM */ 303*7836SJohn.Forte@Sun.COM 304*7836SJohn.Forte@Sun.COM typedef struct dsw_movegrp_s { 305*7836SJohn.Forte@Sun.COM spcs_s_info_t status; 306*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 307*7836SJohn.Forte@Sun.COM char new_group[DSW_NAMELEN]; 308*7836SJohn.Forte@Sun.COM } dsw_movegrp_t; 309*7836SJohn.Forte@Sun.COM 310*7836SJohn.Forte@Sun.COM /* 311*7836SJohn.Forte@Sun.COM * II_PIT_PROPS structure 312*7836SJohn.Forte@Sun.COM */ 313*7836SJohn.Forte@Sun.COM typedef struct pit_props_s { 314*7836SJohn.Forte@Sun.COM int iirc; 315*7836SJohn.Forte@Sun.COM int mstid; 316*7836SJohn.Forte@Sun.COM int shdid; 317*7836SJohn.Forte@Sun.COM int bmpid; 318*7836SJohn.Forte@Sun.COM int ovrid; 319*7836SJohn.Forte@Sun.COM char group[DSW_NAMELEN]; 320*7836SJohn.Forte@Sun.COM char cluster[DSW_NAMELEN]; 321*7836SJohn.Forte@Sun.COM int has_overflow; 322*7836SJohn.Forte@Sun.COM int flags; 323*7836SJohn.Forte@Sun.COM uint64_t size; 324*7836SJohn.Forte@Sun.COM int64_t shdchks; 325*7836SJohn.Forte@Sun.COM int64_t copybits; 326*7836SJohn.Forte@Sun.COM int64_t shdbits; 327*7836SJohn.Forte@Sun.COM } pit_props_t; 328*7836SJohn.Forte@Sun.COM 329*7836SJohn.Forte@Sun.COM /* 330*7836SJohn.Forte@Sun.COM * II_PIT_UPDATE structure 331*7836SJohn.Forte@Sun.COM */ 332*7836SJohn.Forte@Sun.COM typedef struct pit_update_s { 333*7836SJohn.Forte@Sun.COM int iirc; 334*7836SJohn.Forte@Sun.COM char direction; 335*7836SJohn.Forte@Sun.COM } pit_update_t; 336*7836SJohn.Forte@Sun.COM 337*7836SJohn.Forte@Sun.COM #ifdef _KERNEL 338*7836SJohn.Forte@Sun.COM /* 339*7836SJohn.Forte@Sun.COM * 32 bit versions of ioctl structures 340*7836SJohn.Forte@Sun.COM */ 341*7836SJohn.Forte@Sun.COM 342*7836SJohn.Forte@Sun.COM typedef struct dsw_config32_s { 343*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 344*7836SJohn.Forte@Sun.COM char master_vol[DSW_NAMELEN]; 345*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 346*7836SJohn.Forte@Sun.COM char bitmap_vol[DSW_NAMELEN]; 347*7836SJohn.Forte@Sun.COM char cluster_tag[DSW_NAMELEN]; 348*7836SJohn.Forte@Sun.COM char group_name[DSW_NAMELEN]; 349*7836SJohn.Forte@Sun.COM int flag; 350*7836SJohn.Forte@Sun.COM } dsw_config32_t; 351*7836SJohn.Forte@Sun.COM 352*7836SJohn.Forte@Sun.COM /* 353*7836SJohn.Forte@Sun.COM * DSW segmented bitmap I/O structure 354*7836SJohn.Forte@Sun.COM */ 355*7836SJohn.Forte@Sun.COM typedef struct dsw_segment32_s { 356*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 357*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 358*7836SJohn.Forte@Sun.COM uint32_t seg_number; 359*7836SJohn.Forte@Sun.COM uint32_t shd_bitmap; 360*7836SJohn.Forte@Sun.COM int shd_size; 361*7836SJohn.Forte@Sun.COM uint32_t cpy_bitmap; 362*7836SJohn.Forte@Sun.COM int cpy_size; 363*7836SJohn.Forte@Sun.COM uint32_t idx_bitmap; 364*7836SJohn.Forte@Sun.COM int idx_size; 365*7836SJohn.Forte@Sun.COM } dsw_segment32_t; 366*7836SJohn.Forte@Sun.COM 367*7836SJohn.Forte@Sun.COM /* 368*7836SJohn.Forte@Sun.COM * DSW user bitmap structure 369*7836SJohn.Forte@Sun.COM */ 370*7836SJohn.Forte@Sun.COM 371*7836SJohn.Forte@Sun.COM typedef struct dsw_bitmap32_s { 372*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 373*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 374*7836SJohn.Forte@Sun.COM uint32_t shd_bitmap; /* 32 bit pointer value */ 375*7836SJohn.Forte@Sun.COM uint64_t shd_size; 376*7836SJohn.Forte@Sun.COM uint64_t copy_size; 377*7836SJohn.Forte@Sun.COM uint32_t copy_bitmap; /* 32 bit pointer value */ 378*7836SJohn.Forte@Sun.COM } dsw_bitmap32_t; 379*7836SJohn.Forte@Sun.COM 380*7836SJohn.Forte@Sun.COM typedef struct dsw_ioctl32_s { 381*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 382*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 383*7836SJohn.Forte@Sun.COM int flags; 384*7836SJohn.Forte@Sun.COM pid_t pid; 385*7836SJohn.Forte@Sun.COM } dsw_ioctl32_t; 386*7836SJohn.Forte@Sun.COM 387*7836SJohn.Forte@Sun.COM typedef struct dsw_stat32_s { 388*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 389*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 390*7836SJohn.Forte@Sun.COM int stat; 391*7836SJohn.Forte@Sun.COM uint64_t size; 392*7836SJohn.Forte@Sun.COM char overflow_vol[DSW_NAMELEN]; 393*7836SJohn.Forte@Sun.COM uint64_t shdsize; 394*7836SJohn.Forte@Sun.COM uint64_t shdused; 395*7836SJohn.Forte@Sun.COM char group_name[DSW_NAMELEN]; 396*7836SJohn.Forte@Sun.COM char cluster_tag[DSW_NAMELEN]; 397*7836SJohn.Forte@Sun.COM uint64_t mtime; 398*7836SJohn.Forte@Sun.COM } dsw_stat32_t; 399*7836SJohn.Forte@Sun.COM 400*7836SJohn.Forte@Sun.COM typedef struct dsw_version32_s { 401*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 402*7836SJohn.Forte@Sun.COM int major; /* Major release number */ 403*7836SJohn.Forte@Sun.COM int minor; /* Minor release number */ 404*7836SJohn.Forte@Sun.COM int micro; /* Micro release number */ 405*7836SJohn.Forte@Sun.COM int baseline; /* Baseline revision number */ 406*7836SJohn.Forte@Sun.COM } dsw_version32_t; 407*7836SJohn.Forte@Sun.COM 408*7836SJohn.Forte@Sun.COM typedef struct dsw_bitsset32_s { 409*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 410*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 411*7836SJohn.Forte@Sun.COM uint64_t tot_size; /* total number of bits in map */ 412*7836SJohn.Forte@Sun.COM uint64_t tot_set; /* number of bitmap bits set */ 413*7836SJohn.Forte@Sun.COM } dsw_bitsset32_t; 414*7836SJohn.Forte@Sun.COM 415*7836SJohn.Forte@Sun.COM typedef struct dsw_list32_s { 416*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 417*7836SJohn.Forte@Sun.COM int list_size; 418*7836SJohn.Forte@Sun.COM int list_used; 419*7836SJohn.Forte@Sun.COM uint32_t list; 420*7836SJohn.Forte@Sun.COM } dsw_list32_t; 421*7836SJohn.Forte@Sun.COM 422*7836SJohn.Forte@Sun.COM typedef struct dsw_aioctl32_s { 423*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 424*7836SJohn.Forte@Sun.COM int flags; 425*7836SJohn.Forte@Sun.COM int count; 426*7836SJohn.Forte@Sun.COM pid_t pid; 427*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; /* start of list of image sets */ 428*7836SJohn.Forte@Sun.COM } dsw_aioctl32_t; 429*7836SJohn.Forte@Sun.COM 430*7836SJohn.Forte@Sun.COM typedef struct dsw_copyp32_s { 431*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 432*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 433*7836SJohn.Forte@Sun.COM int copy_unit; 434*7836SJohn.Forte@Sun.COM int copy_delay; 435*7836SJohn.Forte@Sun.COM } dsw_copyp32_t; 436*7836SJohn.Forte@Sun.COM 437*7836SJohn.Forte@Sun.COM typedef struct dsw_ostat32_s { 438*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 439*7836SJohn.Forte@Sun.COM char overflow_vol[DSW_NAMELEN]; 440*7836SJohn.Forte@Sun.COM int drefcnt; 441*7836SJohn.Forte@Sun.COM uint64_t used; 442*7836SJohn.Forte@Sun.COM uint64_t unused; 443*7836SJohn.Forte@Sun.COM uint64_t nchunks; 444*7836SJohn.Forte@Sun.COM int crefcnt; 445*7836SJohn.Forte@Sun.COM int flags; 446*7836SJohn.Forte@Sun.COM int hversion; 447*7836SJohn.Forte@Sun.COM int hmagic; 448*7836SJohn.Forte@Sun.COM } dsw_ostat32_t; 449*7836SJohn.Forte@Sun.COM 450*7836SJohn.Forte@Sun.COM /* 451*7836SJohn.Forte@Sun.COM * DSW move group structure 452*7836SJohn.Forte@Sun.COM */ 453*7836SJohn.Forte@Sun.COM 454*7836SJohn.Forte@Sun.COM typedef struct dsw_movegrp32_s { 455*7836SJohn.Forte@Sun.COM spcs_s_info32_t status; 456*7836SJohn.Forte@Sun.COM char shadow_vol[DSW_NAMELEN]; 457*7836SJohn.Forte@Sun.COM char new_group[DSW_NAMELEN]; 458*7836SJohn.Forte@Sun.COM } dsw_movegrp32_t; 459*7836SJohn.Forte@Sun.COM 460*7836SJohn.Forte@Sun.COM #endif /* _KERNEL */ 461*7836SJohn.Forte@Sun.COM 462*7836SJohn.Forte@Sun.COM /* dsw_copy dsw_ioctl_t flag bits */ 463*7836SJohn.Forte@Sun.COM #define CV_BMP_ONLY 0x00000001 /* copy only chunks flagged by bitmap */ 464*7836SJohn.Forte@Sun.COM #define CV_SHD2MST 0x00000002 /* copy shadow to master */ 465*7836SJohn.Forte@Sun.COM #define CV_LOCK_PID 0x00000004 /* On copy/update, lock PIT by PID */ 466*7836SJohn.Forte@Sun.COM #define CV_CLR_BMP 0x00000010 /* clear bits in bit map during copy */ 467*7836SJohn.Forte@Sun.COM #define CV_IS_CLUSTER 0x00000020 /* struct refers to cluster */ 468*7836SJohn.Forte@Sun.COM #define CV_IS_GROUP 0x00000040 /* struct refers to group (cpy/upd) */ 469*7836SJohn.Forte@Sun.COM #define CV_SIBLING 0x00010000 /* internal copy_on_write flag */ 470*7836SJohn.Forte@Sun.COM 471*7836SJohn.Forte@Sun.COM /* nsc_control commands */ 472*7836SJohn.Forte@Sun.COM 473*7836SJohn.Forte@Sun.COM #define II_CONTROL(x) ('I' << 24 | 'I' << 16 | (x)) /* 0x49490000 */ 474*7836SJohn.Forte@Sun.COM 475*7836SJohn.Forte@Sun.COM #define II_PIT_COPY II_CONTROL(1) /* Perform an II Copy */ 476*7836SJohn.Forte@Sun.COM #define II_PIT_UPDATE II_CONTROL(2) /* Perform an II Update */ 477*7836SJohn.Forte@Sun.COM #define II_PIT_ABORT II_CONTROL(3) /* Perform an II Abort */ 478*7836SJohn.Forte@Sun.COM #define II_PIT_WAIT II_CONTROL(4) /* Perform an II Wait */ 479*7836SJohn.Forte@Sun.COM #define II_PIT_PROPS II_CONTROL(5) /* Perform an II Properties */ 480*7836SJohn.Forte@Sun.COM 481*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 482*7836SJohn.Forte@Sun.COM } 483*7836SJohn.Forte@Sun.COM #endif 484*7836SJohn.Forte@Sun.COM 485*7836SJohn.Forte@Sun.COM #endif /* _DSW_H */ 486