Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h
Show All 15 Lines | |||||
* 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, 2017 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_H | #ifndef _SYS_VDEV_H | ||||
#define _SYS_VDEV_H | #define _SYS_VDEV_H | ||||
#include <sys/spa.h> | #include <sys/spa.h> | ||||
#include <sys/zio.h> | #include <sys/zio.h> | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct uberblock; | struct uberblock; | ||||
extern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset); | extern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset); | ||||
extern int vdev_label_number(uint64_t psise, uint64_t offset); | extern int vdev_label_number(uint64_t psise, uint64_t offset); | ||||
extern nvlist_t *vdev_label_read_config(vdev_t *vd, uint64_t txg); | extern nvlist_t *vdev_label_read_config(vdev_t *vd, uint64_t txg); | ||||
extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); | extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); | ||||
extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t | extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t | ||||
offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); | offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); | ||||
extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); | |||||
extern int vdev_label_write_bootenv(vdev_t *, nvlist_t *); | |||||
typedef enum { | typedef enum { | ||||
VDEV_LABEL_CREATE, /* create/add a new device */ | VDEV_LABEL_CREATE, /* create/add a new device */ | ||||
VDEV_LABEL_REPLACE, /* replace an existing device */ | VDEV_LABEL_REPLACE, /* replace an existing device */ | ||||
VDEV_LABEL_SPARE, /* add a new hot spare */ | VDEV_LABEL_SPARE, /* add a new hot spare */ | ||||
VDEV_LABEL_REMOVE, /* remove an existing device */ | VDEV_LABEL_REMOVE, /* remove an existing device */ | ||||
VDEV_LABEL_L2CACHE, /* add an L2ARC cache device */ | VDEV_LABEL_L2CACHE, /* add an L2ARC cache device */ | ||||
VDEV_LABEL_SPLIT /* generating new label for split-off dev */ | VDEV_LABEL_SPLIT /* generating new label for split-off dev */ | ||||
} vdev_labeltype_t; | } vdev_labeltype_t; | ||||
extern int vdev_label_init(vdev_t *vd, uint64_t txg, vdev_labeltype_t reason); | extern int vdev_label_init(vdev_t *vd, uint64_t txg, vdev_labeltype_t reason); | ||||
extern int vdev_label_write_pad2(vdev_t *vd, const char *buf, size_t size); | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#endif /* _SYS_VDEV_H */ | #endif /* _SYS_VDEV_H */ |