cmlb_impl.h revision c31fac72a0572e58d0f06438a238d835dee8ffa7
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Common Development and Distribution License (the "License").
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * or http://www.opensolaris.org/os/licensing.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi *
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifndef _SYS_CMLB_IMPL_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define _SYS_CMLB_IMPL_H
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#ifdef __cplusplus
0eb822a1c0c2bea495647510b75f77f0e57633ebcindiextern "C" {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <sys/cmlb.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <sys/ddi.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#include <sys/sunddi.h>
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * FDISK partitions - 4 primary and MAX_EXT_PARTS number of Extended
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Partitions.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define FDISK_PARTS (FD_NUMPART + MAX_EXT_PARTS)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#if defined(_SUNOS_VTOC_8)
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define NSDMAP NDKMAP
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#elif defined(_SUNOS_VTOC_16)
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define NSDMAP (NDKMAP + FDISK_PARTS + 1)
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#else
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#error "No VTOC format defined."
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#endif
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define MAXPART (NSDMAP + 1)
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define WD_NODE 7
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#if defined(__i386) || defined(__amd64)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define P0_RAW_DISK (NDKMAP)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define FDISK_P1 (NDKMAP+1)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define FDISK_P2 (NDKMAP+2)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define FDISK_P3 (NDKMAP+3)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define FDISK_P4 (NDKMAP+4)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#endif /* __i386 || __amd64 */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi/* Driver Logging Levels */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define CMLB_LOGMASK_ERROR 0x00000001
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define CMLB_LOGMASK_INFO 0x00000002
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_LOGMASK_TRACE 0x00000004
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_TRACE 0x00000001
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_INFO 0x00000002
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_ERROR 0x00000004
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define CMLB_MUTEX(cl) (&((cl)->cl_mutex))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_DEVINFO(cl) ((cl)->cl_devi)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_LABEL(cl) (ddi_driver_name((cl->cl_devi)))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define ISREMOVABLE(cl) (cl->cl_is_removable)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define ISCD(cl) (cl->cl_device_type == DTYPE_RODIRECT)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define ISHOTPLUGGABLE(cl) (cl->cl_is_hotpluggable)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#if defined(_SUNOS_VTOC_8)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define CMLBUNIT_SHIFT 3
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define CMLBPART_MASK 7
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#elif defined(_SUNOS_VTOC_16)
25c6ff4b77fcddf4097ce78a8277275ca603b46cstephh
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLBUNIT_SHIFT 6
dd566498928f08e7c9a79797a40db893c6a4b9fbvn#define CMLBPART_MASK 63
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
25c6ff4b77fcddf4097ce78a8277275ca603b46cstephh#else
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye#error "No VTOC format defined."
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye#endif
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLBUNIT(dev) (getminor((dev)) >> CMLBUNIT_SHIFT)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLBPART(dev) (getminor((dev)) & CMLBPART_MASK)
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi/*
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi * Return codes of cmlb_uselabel().
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_LABEL_IS_VALID 0
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define CMLB_LABEL_IS_INVALID 1
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#define CMLB_2TB_BLOCKS 0xffffffff
940d71d237794874e18a0eb72f6564821a823517eschrock#define CMLB_1TB_BLOCKS 0x7fffffff
940d71d237794874e18a0eb72f6564821a823517eschrock
940d71d237794874e18a0eb72f6564821a823517eschrock#define CMLB_EXTVTOC_LIMIT CMLB_2TB_BLOCKS
940d71d237794874e18a0eb72f6564821a823517eschrock#define CMLB_OLDVTOC_LIMIT CMLB_1TB_BLOCKS
940d71d237794874e18a0eb72f6564821a823517eschrock
940d71d237794874e18a0eb72f6564821a823517eschrock/*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fdisk partition mapping structure
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindistruct fmap {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi ulong_t fmap_start; /* starting block number */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi ulong_t fmap_nblk; /* number of blocks */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uchar_t fmap_systid; /* systid of the partition */
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj};
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj/* for cm_state */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef enum {
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi CMLB_INITED = 0,
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi CMLB_ATTACHED
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} cmlb_state_t;
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecinditypedef enum
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi{
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj CMLB_LABEL_UNDEF = 0,
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj CMLB_LABEL_VTOC,
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj CMLB_LABEL_EFI
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj} cmlb_label_t;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#define CMLB_ALLOW_2TB_WARN 0x1
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robjtypedef struct cmlb_lun {
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj dev_info_t *cl_devi; /* pointer to devinfo */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi struct dk_vtoc cl_vtoc; /* disk VTOC */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj struct dk_geom cl_g; /* disk geometry */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj diskaddr_t cl_blockcount; /* capacity */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj uint32_t cl_tgt_blocksize; /* blocksize */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj diskaddr_t cl_solaris_size; /* size of Solaris partition */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uint_t cl_solaris_offset; /* offset to Solaris part. */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi struct dk_map cl_map[MAXPART]; /* logical partitions */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi /* cylno is overloaded. used */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi /* for starting block for EFI */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi diskaddr_t cl_offset[MAXPART]; /* partition start blocks */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj struct fmap cl_fmap[FDISK_PARTS]; /* fdisk partitions */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uchar_t cl_asciilabel[LEN_DKL_ASCII]; /* Disk ASCII label */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi /*
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * This is the HBAs current notion of the geometry of the drive,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * for HBAs that support the "geometry" property.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi struct cmlb_geom cl_lgeom;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi /*
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * This is the geometry of the device as reported by the MODE SENSE,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * command, Page 3 (Format Device Page) and Page 4 (Rigid Disk Drive
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Geometry Page), assuming MODE SENSE is supported by the target.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi struct cmlb_geom cl_pgeom;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi ushort_t cl_dkg_skew; /* skew */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_label_t cl_def_labeltype; /* default label type */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj /* label type based on which minor nodes were created last */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_label_t cl_last_labeltype;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_label_t cl_cur_labeltype; /* current label type */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj /* indicates whether vtoc label is read from media */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_label_t cl_label_from_media;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_state_t cl_state; /* state of handle */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj boolean_t cl_f_geometry_is_valid;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj int cl_sys_blocksize;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj kmutex_t cl_mutex;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj /* the following are passed in at attach time */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj boolean_t cl_is_removable; /* is removable */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj boolean_t cl_is_hotpluggable; /* is hotpluggable */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj int cl_alter_behavior;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj char *cl_node_type; /* DDI_NT_... */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj int cl_device_type; /* DTYPE_DIRECT,.. */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj int cl_reserved; /* reserved efi partition # */
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj cmlb_tg_ops_t *cmlb_tg_ops;
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj#if defined(__i386) || defined(__amd64)
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj /*
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj * Flag indicating whether extended partition nodes should be created
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj * or not. Is set in cmlb_attach. After creating nodes in
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj * cmlb_read_fdisk, it will be unset.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi int cl_update_ext_minor_nodes;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int cl_logical_drive_count;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#endif /* __i386 || __amd64 */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi uint8_t cl_msglog_flag; /* used to enable/suppress */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi /* certain log messages */
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi} cmlb_lun_t;
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cmlb_tg_ops))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_devi))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_is_removable))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_is_hotpluggable))
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_node_type))
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_sys_blocksize))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("stable data", cmlb_lun::cl_alter_behavior))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("private data", cmlb_geom))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(SCHEME_PROTECTS_DATA("safe sharing", cmlb_lun::cl_f_geometry_is_valid))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi_NOTE(MUTEX_PROTECTS_DATA(cmlb_lun::cl_mutex, cmlb_lun::cl_vtoc))
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define DK_TG_READ(ihdlp, bufaddr, start_block, reqlength, tg_cookie)\
c40d7343efa60b18ad1ceb316eb337caeea79046cindi (ihdlp->cmlb_tg_ops->tg_rdwr)(CMLB_DEVINFO(ihdlp), TG_READ, \
c40d7343efa60b18ad1ceb316eb337caeea79046cindi bufaddr, start_block, reqlength, tg_cookie)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define DK_TG_WRITE(ihdlp, bufaddr, start_block, reqlength, tg_cookie)\
c40d7343efa60b18ad1ceb316eb337caeea79046cindi (ihdlp->cmlb_tg_ops->tg_rdwr)(CMLB_DEVINFO(ihdlp), TG_WRITE,\
c40d7343efa60b18ad1ceb316eb337caeea79046cindi bufaddr, start_block, reqlength, tg_cookie)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define DK_TG_GETPHYGEOM(ihdlp, phygeomp, tg_cookie) \
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (ihdlp->cmlb_tg_ops->tg_getinfo)(CMLB_DEVINFO(ihdlp), TG_GETPHYGEOM,\
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void *)phygeomp, tg_cookie)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define DK_TG_GETVIRTGEOM(ihdlp, virtgeomp, tg_cookie) \
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (ihdlp->cmlb_tg_ops->tg_getinfo)(CMLB_DEVINFO(ihdlp), TG_GETVIRTGEOM,\
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void *)virtgeomp, tg_cookie)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define DK_TG_GETCAP(ihdlp, capp, tg_cookie) \
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (ihdlp->cmlb_tg_ops->tg_getinfo)(CMLB_DEVINFO(ihdlp), TG_GETCAPACITY,\
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi capp, tg_cookie)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#define DK_TG_GETBLOCKSIZE(ihdlp, lbap, tg_cookie) \
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (ihdlp->cmlb_tg_ops->tg_getinfo)(CMLB_DEVINFO(ihdlp),\
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi TG_GETBLOCKSIZE, lbap, tg_cookie)
dd566498928f08e7c9a79797a40db893c6a4b9fbvn
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#define DK_TG_GETATTRIBUTE(ihdlp, attributep, tg_cookie) \
c40d7343efa60b18ad1ceb316eb337caeea79046cindi (ihdlp->cmlb_tg_ops->tg_getinfo)(CMLB_DEVINFO(ihdlp), TG_GETATTR,\
c40d7343efa60b18ad1ceb316eb337caeea79046cindi attributep, tg_cookie)
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#ifdef __cplusplus
c40d7343efa60b18ad1ceb316eb337caeea79046cindi}
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#endif
c40d7343efa60b18ad1ceb316eb337caeea79046cindi
c40d7343efa60b18ad1ceb316eb337caeea79046cindi#endif /* _SYS_CMLB_IMPL_H */
dd566498928f08e7c9a79797a40db893c6a4b9fbvn