Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/boot/zfs/zfsimpl.h
Show First 20 Lines • Show All 521 Lines • ▼ Show 20 Lines | |||||
#define VDEV_UBERBLOCK_SIZE(vd) (1ULL << VDEV_UBERBLOCK_SHIFT(vd)) | #define VDEV_UBERBLOCK_SIZE(vd) (1ULL << VDEV_UBERBLOCK_SHIFT(vd)) | ||||
typedef struct vdev_phys { | typedef struct vdev_phys { | ||||
char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)]; | char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)]; | ||||
zio_eck_t vp_zbt; | zio_eck_t vp_zbt; | ||||
} vdev_phys_t; | } vdev_phys_t; | ||||
typedef enum vbe_vers { | typedef enum vbe_vers { | ||||
/* The bootenv file is stored as ascii text in the envblock */ | /* The bootenv file is stored as ascii text in the envblock */ | ||||
VB_RAW = 0, | VB_RAW = 0, | ||||
/* | /* | ||||
* The bootenv file is converted to an nvlist and then packed into the | * The bootenv file is converted to an nvlist and then packed into the | ||||
* envblock. | * envblock. | ||||
*/ | */ | ||||
VB_NVLIST = 1 | VB_NVLIST = 1 | ||||
} vbe_vers_t; | } vbe_vers_t; | ||||
typedef struct vdev_boot_envblock { | typedef struct vdev_boot_envblock { | ||||
uint64_t vbe_version; | uint64_t vbe_version; | ||||
char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) - | char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) - | ||||
sizeof (zio_eck_t)]; | sizeof (zio_eck_t)]; | ||||
zio_eck_t vbe_zbt; | zio_eck_t vbe_zbt; | ||||
} vdev_boot_envblock_t; | } vdev_boot_envblock_t; | ||||
CTASSERT(sizeof (vdev_boot_envblock_t) == VDEV_PAD_SIZE); | CTASSERT(sizeof (vdev_boot_envblock_t) == VDEV_PAD_SIZE); | ||||
typedef struct vdev_label { | typedef struct vdev_label { | ||||
char vl_pad1[VDEV_PAD_SIZE]; /* 8K */ | char vl_pad1[VDEV_PAD_SIZE]; /* 8K */ | ||||
vdev_boot_envblock_t vl_be; /* 8K */ | vdev_boot_envblock_t vl_be; /* 8K */ | ||||
▲ Show 20 Lines • Show All 1,106 Lines • ▼ Show 20 Lines | typedef struct znode_phys { | ||||
*/ | */ | ||||
} znode_phys_t; | } znode_phys_t; | ||||
/* | /* | ||||
* In-core vdev representation. | * In-core vdev representation. | ||||
*/ | */ | ||||
struct vdev; | struct vdev; | ||||
struct spa; | struct spa; | ||||
typedef int vdev_phys_read_t(struct vdev *vdev, void *priv, | typedef int vdev_phys_read_t(struct vdev *, void *, off_t, void *, size_t); | ||||
off_t offset, void *buf, size_t bytes); | typedef int vdev_phys_write_t(struct vdev *, off_t, void *, size_t); | ||||
typedef int vdev_read_t(struct vdev *vdev, const blkptr_t *bp, | typedef int vdev_read_t(struct vdev *, const blkptr_t *, void *, off_t, size_t); | ||||
void *buf, off_t offset, size_t bytes); | |||||
typedef STAILQ_HEAD(vdev_list, vdev) vdev_list_t; | typedef STAILQ_HEAD(vdev_list, vdev) vdev_list_t; | ||||
typedef struct vdev_indirect_mapping_entry_phys { | typedef struct vdev_indirect_mapping_entry_phys { | ||||
/* | /* | ||||
* Decode with DVA_MAPPING_* macros. | * Decode with DVA_MAPPING_* macros. | ||||
* Contains: | * Contains: | ||||
* the source offset (low 63 bits) | * the source offset (low 63 bits) | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | typedef struct vdev { | ||||
uint64_t v_id; /* index in parent */ | uint64_t v_id; /* index in parent */ | ||||
uint64_t v_psize; /* physical device capacity */ | uint64_t v_psize; /* physical device capacity */ | ||||
int v_ashift; /* offset to block shift */ | int v_ashift; /* offset to block shift */ | ||||
int v_nparity; /* # parity for raidz */ | int v_nparity; /* # parity for raidz */ | ||||
struct vdev *v_top; /* parent vdev */ | struct vdev *v_top; /* parent vdev */ | ||||
size_t v_nchildren; /* # children */ | size_t v_nchildren; /* # children */ | ||||
vdev_state_t v_state; /* current state */ | vdev_state_t v_state; /* current state */ | ||||
vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ | vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ | ||||
vdev_phys_write_t *v_phys_write; /* write to raw leaf vdev */ | |||||
vdev_read_t *v_read; /* read from vdev */ | vdev_read_t *v_read; /* read from vdev */ | ||||
void *v_read_priv; /* private data for read function */ | void *v_priv; /* data for read/write function */ | ||||
boolean_t v_islog; | boolean_t v_islog; | ||||
struct spa *v_spa; /* link to spa */ | struct spa *v_spa; /* link to spa */ | ||||
/* | /* | ||||
* Values stored in the config for an indirect or removing vdev. | * Values stored in the config for an indirect or removing vdev. | ||||
*/ | */ | ||||
vdev_indirect_config_t vdev_indirect_config; | vdev_indirect_config_t vdev_indirect_config; | ||||
vdev_indirect_mapping_t *v_mapping; | vdev_indirect_mapping_t *v_mapping; | ||||
} vdev_t; | } vdev_t; | ||||
Show All 10 Lines | typedef struct spa { | ||||
uint64_t spa_txg; /* most recent transaction */ | uint64_t spa_txg; /* most recent transaction */ | ||||
struct uberblock *spa_uberblock; /* best uberblock so far */ | struct uberblock *spa_uberblock; /* best uberblock so far */ | ||||
vdev_t *spa_root_vdev; /* toplevel vdev container */ | vdev_t *spa_root_vdev; /* toplevel vdev container */ | ||||
objset_phys_t *spa_mos; /* MOS for this pool */ | objset_phys_t *spa_mos; /* MOS for this pool */ | ||||
zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ | zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ | ||||
void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; | void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; | ||||
boolean_t spa_with_log; /* this pool has log */ | boolean_t spa_with_log; /* this pool has log */ | ||||
struct uberblock spa_uberblock_master; /* best uberblock so far */ | struct uberblock spa_uberblock_master; /* best uberblock so far */ | ||||
objset_phys_t spa_mos_master; /* MOS for this pool */ | objset_phys_t spa_mos_master; /* MOS for this pool */ | ||||
struct uberblock spa_uberblock_checkpoint; /* checkpoint uberblock */ | struct uberblock spa_uberblock_checkpoint; /* checkpoint uberblock */ | ||||
objset_phys_t spa_mos_checkpoint; /* Checkpoint MOS */ | objset_phys_t spa_mos_checkpoint; /* Checkpoint MOS */ | ||||
void *spa_bootenv; /* bootenv from pool label */ | |||||
} spa_t; | } spa_t; | ||||
/* IO related arguments. */ | /* IO related arguments. */ | ||||
typedef struct zio { | typedef struct zio { | ||||
spa_t *io_spa; | spa_t *io_spa; | ||||
blkptr_t *io_bp; | blkptr_t *io_bp; | ||||
void *io_data; | void *io_data; | ||||
uint64_t io_size; | uint64_t io_size; | ||||
Show All 12 Lines |