Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/contrib/openzfs/lib/libzutil/zutil_import.h
48375 views
1
// SPDX-License-Identifier: CDDL-1.0
2
/*
3
* CDDL HEADER START
4
*
5
* The contents of this file are subject to the terms of the
6
* Common Development and Distribution License (the "License").
7
* You may not use this file except in compliance with the License.
8
*
9
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10
* or https://opensource.org/licenses/CDDL-1.0.
11
* See the License for the specific language governing permissions
12
* and limitations under the License.
13
*
14
* When distributing Covered Code, include this CDDL HEADER in each
15
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16
* If applicable, add the following below this CDDL HEADER, with the
17
* fields enclosed by brackets "[]" replaced with your own identifying
18
* information: Portions Copyright [yyyy] [name of copyright owner]
19
*
20
* CDDL HEADER END
21
*/
22
/*
23
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
25
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
26
* Copyright 2015 RackTop Systems.
27
* Copyright (c) 2016, Intel Corporation.
28
*/
29
#ifndef _LIBZUTIL_ZUTIL_IMPORT_H_
30
#define _LIBZUTIL_ZUTIL_IMPORT_H_
31
32
#define IMPORT_ORDER_PREFERRED_1 1
33
#define IMPORT_ORDER_PREFERRED_2 2
34
#define IMPORT_ORDER_SCAN_OFFSET 10
35
#define IMPORT_ORDER_DEFAULT 100
36
37
int label_paths(libpc_handle_t *hdl, nvlist_t *label, const char **path,
38
const char **devid);
39
int zpool_find_import_blkid(libpc_handle_t *hdl, pthread_mutex_t *lock,
40
avl_tree_t **slice_cache);
41
42
void * zutil_alloc(libpc_handle_t *hdl, size_t size);
43
char *zutil_strdup(libpc_handle_t *hdl, const char *str);
44
45
typedef struct rdsk_node {
46
char *rn_name; /* Full path to device */
47
int rn_order; /* Preferred order (low to high) */
48
int rn_num_labels; /* Number of valid labels */
49
uint64_t rn_vdev_guid; /* Expected vdev guid when set */
50
libpc_handle_t *rn_hdl;
51
nvlist_t *rn_config; /* Label config */
52
avl_tree_t *rn_avl;
53
avl_node_t rn_node;
54
pthread_mutex_t *rn_lock;
55
boolean_t rn_labelpaths;
56
} rdsk_node_t;
57
58
int slice_cache_compare(const void *, const void *);
59
60
void zpool_open_func(void *);
61
62
#endif /* _LIBZUTIL_ZUTIL_IMPORT_H_ */
63
64