Path: blob/main/sys/contrib/openzfs/cmd/zinject/zinject.h
48383 views
// SPDX-License-Identifier: CDDL-1.01/*2* CDDL HEADER START3*4* The contents of this file are subject to the terms of the5* Common Development and Distribution License (the "License").6* You may not use this file except in compliance with the License.7*8* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE9* or https://opensource.org/licenses/CDDL-1.0.10* See the License for the specific language governing permissions11* and limitations under the License.12*13* When distributing Covered Code, include this CDDL HEADER in each14* file and include the License file at usr/src/OPENSOLARIS.LICENSE.15* If applicable, add the following below this CDDL HEADER, with the16* fields enclosed by brackets "[]" replaced with your own identifying17* information: Portions Copyright [yyyy] [name of copyright owner]18*19* CDDL HEADER END20*/21/*22* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.23*/2425#ifndef _ZINJECT_H26#define _ZINJECT_H2728#include <sys/zfs_ioctl.h>2930#ifdef __cplusplus31extern "C" {32#endif3334typedef enum {35TYPE_DATA, /* plain file contents */36TYPE_DNODE, /* metadnode contents */37TYPE_MOS, /* all MOS data */38TYPE_MOSDIR, /* MOS object directory */39TYPE_METASLAB, /* metaslab objects */40TYPE_CONFIG, /* MOS config */41TYPE_BPOBJ, /* block pointer list */42TYPE_SPACEMAP, /* space map objects */43TYPE_ERRLOG, /* persistent error log */44TYPE_LABEL_UBERBLOCK, /* label specific uberblock */45TYPE_LABEL_NVLIST, /* label specific nvlist */46TYPE_LABEL_PAD1, /* label specific 8K pad1 area */47TYPE_LABEL_PAD2, /* label specific 8K pad2 area */48TYPE_INVAL49} err_type_t;5051#define MOS_TYPE(t) \52((t) >= TYPE_MOS && (t) < TYPE_LABEL_UBERBLOCK)5354#define LABEL_TYPE(t) \55((t) >= TYPE_LABEL_UBERBLOCK && (t) < TYPE_INVAL)5657int translate_record(err_type_t type, const char *object, const char *range,58int level, zinject_record_t *record, char *poolname, char *dataset);59int translate_raw(const char *raw, zinject_record_t *record);60int translate_device(const char *pool, const char *device,61err_type_t label_type, zinject_record_t *record);62void usage(void);6364extern libzfs_handle_t *g_zfs;6566#ifdef __cplusplus67}68#endif6970#endif /* _ZINJECT_H */717273