Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
Show All 14 Lines | |||||
* If applicable, add the following below this CDDL HEADER, with the | * If applicable, add the following below this CDDL HEADER, with the | ||||
* fields enclosed by brackets "[]" replaced with your own identifying | * fields enclosed by brackets "[]" replaced with your own identifying | ||||
* information: Portions Copyright [yyyy] [name of copyright owner] | * information: Portions Copyright [yyyy] [name of copyright owner] | ||||
* | * | ||||
* CDDL HEADER END | * CDDL HEADER END | ||||
*/ | */ | ||||
/* | /* | ||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | ||||
* Copyright (c) 2011, 2018 by Delphix. All rights reserved. | * Copyright (c) 2011, 2020 by Delphix. All rights reserved. | ||||
* Copyright (c) 2017, Intel Corporation. | * Copyright (c) 2017, Intel Corporation. | ||||
*/ | */ | ||||
#ifndef _SYS_VDEV_IMPL_H | #ifndef _SYS_VDEV_IMPL_H | ||||
#define _SYS_VDEV_IMPL_H | #define _SYS_VDEV_IMPL_H | ||||
#include <sys/avl.h> | #include <sys/avl.h> | ||||
#include <sys/bpobj.h> | #include <sys/bpobj.h> | ||||
▲ Show 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | struct vdev { | ||||
kmutex_t vdev_dtl_lock; /* vdev_dtl_{map,resilver} */ | kmutex_t vdev_dtl_lock; /* vdev_dtl_{map,resilver} */ | ||||
kmutex_t vdev_stat_lock; /* vdev_stat */ | kmutex_t vdev_stat_lock; /* vdev_stat */ | ||||
kmutex_t vdev_probe_lock; /* protects vdev_probe_zio */ | kmutex_t vdev_probe_lock; /* protects vdev_probe_zio */ | ||||
}; | }; | ||||
#define VDEV_RAIDZ_MAXPARITY 3 | #define VDEV_RAIDZ_MAXPARITY 3 | ||||
#define VDEV_PAD_SIZE (8 << 10) | #define VDEV_PAD_SIZE (8 << 10) | ||||
/* 2 padding areas (vl_pad1 and vl_pad2) to skip */ | /* 2 padding areas (vl_pad1 and vl_be) to skip */ | ||||
#define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2 | #define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2 | ||||
#define VDEV_PHYS_SIZE (112 << 10) | #define VDEV_PHYS_SIZE (112 << 10) | ||||
#define VDEV_UBERBLOCK_RING (128 << 10) | #define VDEV_UBERBLOCK_RING (128 << 10) | ||||
/* | /* | ||||
* MMP blocks occupy the last MMP_BLOCKS_PER_LABEL slots in the uberblock | * MMP blocks occupy the last MMP_BLOCKS_PER_LABEL slots in the uberblock | ||||
* ring when MMP is enabled. | * ring when MMP is enabled. | ||||
*/ | */ | ||||
Show All 10 Lines | #define VDEV_UBERBLOCK_OFFSET(vd, n) \ | ||||
offsetof(vdev_label_t, vl_uberblock[(n) << VDEV_UBERBLOCK_SHIFT(vd)]) | offsetof(vdev_label_t, vl_uberblock[(n) << VDEV_UBERBLOCK_SHIFT(vd)]) | ||||
#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 { | |||||
/* The bootenv file is stored as ascii text in the envblock */ | |||||
VB_RAW = 0, | |||||
/* | |||||
* The bootenv file is converted to an nvlist and then packed into the | |||||
* envblock. | |||||
*/ | |||||
VB_NVLIST = 1 | |||||
} vbe_vers_t; | |||||
typedef struct vdev_boot_envblock { | |||||
uint64_t vbe_version; | |||||
char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) - | |||||
sizeof (zio_eck_t)]; | |||||
zio_eck_t vbe_zbt; | |||||
} vdev_boot_envblock_t; | |||||
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 */ | ||||
char vl_pad2[VDEV_PAD_SIZE]; /* 8K */ | vdev_boot_envblock_t vl_be; /* 8K */ | ||||
vdev_phys_t vl_vdev_phys; /* 112K */ | vdev_phys_t vl_vdev_phys; /* 112K */ | ||||
char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */ | char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */ | ||||
} vdev_label_t; /* 256K total */ | } vdev_label_t; /* 256K total */ | ||||
/* | /* | ||||
* vdev_dirty() flags | * vdev_dirty() flags | ||||
*/ | */ | ||||
#define VDD_METASLAB 0x01 | #define VDD_METASLAB 0x01 | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |