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