Path: blob/main/sys/contrib/openzfs/lib/libzutil/zutil_import.h
48375 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 2015 Nexenta Systems, Inc. All rights reserved.23* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.24* Copyright (c) 2012, 2018 by Delphix. All rights reserved.25* Copyright 2015 RackTop Systems.26* Copyright (c) 2016, Intel Corporation.27*/28#ifndef _LIBZUTIL_ZUTIL_IMPORT_H_29#define _LIBZUTIL_ZUTIL_IMPORT_H_3031#define IMPORT_ORDER_PREFERRED_1 132#define IMPORT_ORDER_PREFERRED_2 233#define IMPORT_ORDER_SCAN_OFFSET 1034#define IMPORT_ORDER_DEFAULT 1003536int label_paths(libpc_handle_t *hdl, nvlist_t *label, const char **path,37const char **devid);38int zpool_find_import_blkid(libpc_handle_t *hdl, pthread_mutex_t *lock,39avl_tree_t **slice_cache);4041void * zutil_alloc(libpc_handle_t *hdl, size_t size);42char *zutil_strdup(libpc_handle_t *hdl, const char *str);4344typedef struct rdsk_node {45char *rn_name; /* Full path to device */46int rn_order; /* Preferred order (low to high) */47int rn_num_labels; /* Number of valid labels */48uint64_t rn_vdev_guid; /* Expected vdev guid when set */49libpc_handle_t *rn_hdl;50nvlist_t *rn_config; /* Label config */51avl_tree_t *rn_avl;52avl_node_t rn_node;53pthread_mutex_t *rn_lock;54boolean_t rn_labelpaths;55} rdsk_node_t;5657int slice_cache_compare(const void *, const void *);5859void zpool_open_func(void *);6061#endif /* _LIBZUTIL_ZUTIL_IMPORT_H_ */626364