2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _FMD_ZFS_H
2N/A#define _FMD_ZFS_H
2N/A
2N/A#include <libnvpair.h>
2N/A#include <libzfs.h>
2N/A#include <sys/dditypes.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Atypedef enum {
2N/A VDEV_NULL,
2N/A VDEV_IS_DATA,
2N/A VDEV_IS_LOG,
2N/A VDEV_IS_CACHE,
2N/A VDEV_IS_AVAIL_SPARE,
2N/A VDEV_IS_ACTIVE_SPARE,
2N/A VDEV_IS_SPARED_DATA,
2N/A VDEV_IS_SPARED_LOG,
2N/A VDEV_IS_REPLACING
2N/A} vdev_type_t;
2N/A
2N/Atypedef int (*fmd_zfs_func_t)(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/A#define FMD_ZFS_ITER_CONTINUE 1
2N/A#define FMD_ZFS_ITER_TERMINATE 2
2N/A
2N/Atypedef struct fmd_zfs_cb {
2N/A char *fz_devchassis;
2N/A char *fz_chassissn;
2N/A char *fz_location;
2N/A char *fz_physpath;
2N/A char *fz_devid;
2N/A char *fz_path;
2N/A boolean_t fz_isrestart;
2N/A} fmd_zfs_cb_t;
2N/A
2N/Aextern int fmd_zfs_replace_with_spare(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_fault_vdev(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_degrade_vdev(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_clear_vdev(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_in_config(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_vdev_state(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern void fmd_zfs_iter_by_location(libzfs_handle_t *, char *, char *,
2N/A fmd_zfs_func_t, void *);
2N/Aextern void fmd_zfs_iter_all(libzfs_handle_t *, fmd_zfs_func_t, void *);
2N/Aextern void fmd_zfs_iter_by_devpath(libzfs_handle_t *, char *,
2N/A fmd_zfs_func_t, void *);
2N/Aextern void fmd_zfs_iter_by_devid(libzfs_handle_t *, char *,
2N/A fmd_zfs_func_t, void *);
2N/Aextern void fmd_zfs_iter_by_guid(libzfs_handle_t *, uint64_t, uint64_t,
2N/A fmd_zfs_func_t, void *);
2N/Aextern int fmd_zfs_autoreplace(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_set_location(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_reonline(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/Aextern int fmd_zfs_autoexpand(zpool_handle_t *, nvlist_t *, void *,
2N/A vdev_type_t, nvlist_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _FMD_ZFS_H */