fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Definitions for kstats
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_SKSTAT_THROTTLE_UNIT "ii_throttle_unit"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_SKSTAT_THROTTLE_DELAY "ii_throttle_delay"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bitmap macros
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BIT_CLR(bmap, bit) (bmap &= (char)~(1 << bit))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BIT_SET(bmap, bit) (bmap |= (char)(1 << bit))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BIT_ISSET(bmap, bit) ((bmap & (1 << bit)) != 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_CBLK_FBA 16 /* cache blocks in fba's */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_SHD_BM_OFFSET DSW_CBLK_FBA /* offset to allow for header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BM_FBA_LEN(mst_size) ((mst_size) / FBA_SIZE(DSW_SIZE*DSW_BITS) + \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BM_SIZE_CHUNKS(ip) ((ip->bi_size + DSW_SIZE - 1) / DSW_SIZE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_BM_SIZE_BYTES(ip) ((DSW_BM_SIZE_CHUNKS(ip) + DSW_BITS - 1) / \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_CHK2FBA(chunk) (((nsc_off_t)(chunk)) * DSW_SIZE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Shadow types.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Miscellaneous defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_EXISTING 0x01 /* Internal dsw_ioctl()/dsw_config() flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * defines for _ii_nsc_io and _ii_write, used by kstats
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * global kstats
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* static */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* dynamic */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set-specific kstats
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kstat_named_t shdbits; /* # bits set shadow bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kstat_named_t copybits; /* # bits set copy bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Basic types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * OV_HEADER_VERSION
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 = original OV header version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1 = flags support
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Overflow disk volume header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ii_dvolname[DSW_NAMELEN]; /* this volumes name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_dfreehead; /* chain of freed chunks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_dnchunks; /* total number of chunks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_dunused; /* number of chunks available */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_dused; /* number of chunks allocated */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_urefcnt; /* # shadows needing update */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_dcrefcnt; /* current number of users */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Overflow volume in core structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t ii_kstat_mutex; /* Mutex for overflow kstat */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ii_detachcnt; /* users detaching on disable */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_overflow_s *ii_next; /* chain of incore structs */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_dev_s *ii_dev; /* pointer to device details */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kstat_t *ii_overflow; /* kstats data for this vol */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ii_ioname[KSTAT_DATA_CHAR_LEN]; /* name for iostat -x */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_OHEADER_FBA 0 /* overflow header location */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * logging of kstat_io
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_KS(ip, x) KSTAT_IO_PTR(ip->bi_kstat_io.x)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_MUTEX(ip, x) ip->bi_kstat_io.x->ks_lock
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte II_KS(ip, type)->nread += II_BLKSIZE * (blocks);\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte II_KS(ip, type)->nwritten += II_BLKSIZE * (blocks);\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_NSC_READ(ip, type, rc, buf, pos, len, flag) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_NSC_WRITE(ip, type, rc, buf, pos, len, flag) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_NSC_COPY_DIRECT(ip, t1, t2, rc, buf1, buf2, pos1, pos2, len) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rc = nsc_copy_direct(buf1, buf2, pos1, pos2, len); \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_ALLOC_BUF(ip, type, rc, fd, pos, len, flag, tmp) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All kstat_io associated with a set. NOTE: only one mutex for all
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of the kstats for a given set; all master/shadow/bmp/overflow mutexes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * point back to the statmutex
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char mstio[KSTAT_DATA_CHAR_LEN]; /* name of mst in iostat -x */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char shdio[KSTAT_DATA_CHAR_LEN]; /* name of shd in iostat -x */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char bmpio[KSTAT_DATA_CHAR_LEN]; /* name of bmp in iostat -x */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ovrio[KSTAT_DATA_CHAR_LEN]; /* name of ovr in iostat -x */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * II device info structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_iodev_t *bi_iodev; /* I/O device structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_s *bi_next; /* Chain of all groups */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_s *bi_head; /* head of sibling chain */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_s *bi_sibling; /* Chain of groups with same */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* master */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_s *bi_master; /* location of master */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_info_s *bi_nextmst; /* next multimaster */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char *bi_bitmap; /* Master device bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t bi_shdfba; /* location of shadow bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_size_t bi_shdbits; /* shadow bitmap counter */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t bi_copyfba; /* location of copy bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_size_t bi_copybits; /* copy bitmap counter */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kcondvar_t bi_copydonecv; /* Copy operation condvar */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kcondvar_t bi_closingcv; /* Shadow closing condvar */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kcondvar_t bi_ioctlcv; /* Ioctls complete condvar */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_bmp_ops_s *bi_bitmap_ops; /* Functions for bitmap ops */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t bi_rsrvmutex; /* Reserve operation mutex */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t bi_rlsemutex; /* Release operation mutex */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t bi_bmpmutex; /* mutex for bi_bitmap_ops */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte chunkid_t bi_shdchks; /* # of chunks on shadow vol */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte chunkid_t bi_shdfchk; /* start of shd chunk flst */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct ii_fd_s *bi_iifd; /* fd holding master's ip */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte krwlock_t bi_linkrw; /* altering linkage rwlock */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t bi_chksmutex; /* Mutex for bi_???chks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pid_t bi_locked_pid; /* lock pid for update/copy */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ii_kstat_info_t bi_kstat_io; /* kstat I/O data for set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Cluster and group linked lists
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_lstinfo_s *lst_next; /* ptr to next in chain */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _ii_lstinfo_t *lst_start; /* start of set list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct _ii_lsthead_s *lst_next; /* next list head */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Flag set and clear macros and function.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid _ii_flag_op(int and, int or, _ii_info_t *ip, int update);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FLAG_SET(f, ip) _ii_flag_op(~0, (f), ip, TRUE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FLAG_CLR(f, ip) _ii_flag_op(~(f), 0, ip, TRUE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FLAG_SETX(f, ip) _ii_flag_op(~0, (f), ip, FALSE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FLAG_CLRX(f, ip) _ii_flag_op(~(f), 0, ip, FALSE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FLAG_ASSIGN(f, ip) _ii_flag_op(0, (f), ip, FALSE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_do_sysevent("ii", msg, level, level, component, ii_dip);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Reserve and release macros */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* also used by ii_volume() volume identification, hence NONE & OVR */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MST 0x0001 /* master reserve/release flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MSTR 0x0010 /* raw master reserve/release flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SHD 0x0002 /* shadow reserve/release flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SHDR 0x0020 /* raw shadow reserve/release flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define BMP 0x0100 /* bitmap reserve/release flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RSRV(ip) ((ip)->bi_rsrv > 0 || (ip)->bi_orsrv > 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MSTFD(ip) (MSTRSRV(ip) ? (ip)->bi_mstfd : (ip)->bi_mstrfd)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SHDFD(ip) (SHDRSRV(ip) ? (ip)->bi_shdfd : (ip)->bi_shdrfd)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define OVRFD(ip) (ip->bi_overflow->ii_dev->bi_fd)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_RAW(ii) (((ii)->ii_oflags&NSC_DEVICE) != 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FD(ii) ((ii)->ii_shd ? SHDFD((ii)->ii_info) : \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* are there multiple shadows of ip's master volume? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSHADOWS(ip) ((ip)->bi_head != (ip) || (ip)->bi_sibling)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*co_bmp)(_ii_info_t *, nsc_off_t, unsigned char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*ci_bmp)(_ii_info_t *, nsc_off_t, unsigned char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*clr_copy_bits)(_ii_info_t *, chunkid_t, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte chunkid_t (*next_copy_bit)(_ii_info_t *, chunkid_t, chunkid_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*change_bmp)(_ii_info_t *, unsigned char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*cnt_bits)(_ii_info_t *, nsc_off_t, nsc_size_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CO_BMP(ip, a, b, c) (*(ip)->bi_bitmap_ops->co_bmp)(ip, a, b, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CI_BMP(ip, a, b, c) (*(ip)->bi_bitmap_ops->ci_bmp)(ip, a, b, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_ZEROBM(ip) (*(ip)->bi_bitmap_ops->zerobm)(ip)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_COPYBM(ip) (*(ip)->bi_bitmap_ops->copybm)(ip)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_ORBM(ip) (*(ip)->bi_bitmap_ops->orbm)(ip)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_TST_SHD_BIT(ip, c) (*(ip)->bi_bitmap_ops->tst_shd_bit)(ip, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_SET_SHD_BIT(ip, c) (*(ip)->bi_bitmap_ops->set_shd_bit)(ip, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_TST_COPY_BIT(ip, c) (*(ip)->bi_bitmap_ops->tst_copy_bit)(ip, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_SET_COPY_BIT(ip, c) (*(ip)->bi_bitmap_ops->set_copy_bit)(ip, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CLR_COPY_BITS(ip, c, n) (*(ip)->bi_bitmap_ops->clr_copy_bits) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CLR_COPY_BIT(ip, c) (*(ip)->bi_bitmap_ops->clr_copy_bits)(ip, c, 1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (*(ip)->bi_bitmap_ops->next_copy_bit)(ip, c, m, w, g)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_FILL_COPY_BMP(ip) (*(ip)->bi_bitmap_ops->fill_copy_bmp)(ip)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_LOAD_BMP(ip, f) (*(ip)->bi_bitmap_ops->load_bmp)(ip, f)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_SAVE_BMP(ip, f) (*(ip)->bi_bitmap_ops->save_bmp)(ip, f)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CHANGE_BMP(ip, p) (*(ip)->bi_bitmap_ops->change_bmp)(ip, p)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_CNT_BITS(ip, a, b, c) (*(ip)->bi_bitmap_ops->cnt_bits)(ip, a, b, c)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_JOIN_BMP(dip, sip) (*(ip)->bi_bitmap_ops->join_bmp)(dip, sip)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * State flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_IOCTL 0x0001 /* Waiting for ioctl to complete */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_CLOSING 0x0002 /* Waiting for shadow to close */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_MSTTARGET 0x0004 /* Master is target of update */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_MULTIMST 0x0008 /* disabled set is multi master */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_CNTSHDBITS 0x0010 /* need to count # of shd bits set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DSW_CNTCPYBITS 0x0020 /* need to count # of copy bits set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DSW file descriptor structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ii_shd; /* This fd is for the shadow device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ii_ovr; /* This fd is for the overflow device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _ii_overflow_t *ii_optr; /* pointer to overflow structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * II buffer header
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_buf_t *ii_bufp2; /* second underlying buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_buf_t *ii_abufp; /* anonymous underlying buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _KERNEL || _KMEMUSER */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Valid magic numbers in the bitmap volume header
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * II_HEADER_VERSION
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1 = original II header version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2 = Compact Dependent Shadows (DSW_TREEMAP)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 3 = Persistance of throttle parameters
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 4 = add cluster & group information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 5 = add time string to hold last modify time
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DSW bitmap volume header structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_type; /* bitmap or independent copy */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_state; /* State of the master/shadow/bitmap tuple */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_version; /* version or format of bitmap volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_shdfba; /* location of shadow bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_copyfba; /* location of copy bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* II_HEADER_VERSION 2 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_mstchks; /* # of chunks in master volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_shdchks; /* # of chunks in shadow volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_shdchkused; /* # of shd chunks allocated or on free list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t ii_shdfchk; /* list of free shadow chunks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* II_HEADER_VERSION 3 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_throttle_unit; /* Last setting of throttle unit */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t ii_throttle_delay; /* Last setting of throttle delay */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* II_HEADER_VERSION 4 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* II_HEADER_VERSION 5 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_SUCCESS(rc) (((rc) == NSC_DONE) || ((rc) == NSC_HIT))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Overflow volume defines.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define II_ISOVERFLOW(n) ((n) < 0 && (n) != II_NULLCHUNK)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* -tive node id's are in overflow volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* II_MULTIMULTI_TERABYTE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _DSW_DEV_H */