1 789 ahrens /* 2 789 ahrens * CDDL HEADER START 3 789 ahrens * 4 789 ahrens * The contents of this file are subject to the terms of the 5 2082 eschrock * Common Development and Distribution License (the "License"). 6 2082 eschrock * You may not use this file except in compliance with the License. 7 789 ahrens * 8 789 ahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 789 ahrens * or http://www.opensolaris.org/os/licensing. 10 789 ahrens * See the License for the specific language governing permissions 11 789 ahrens * and limitations under the License. 12 789 ahrens * 13 789 ahrens * When distributing Covered Code, include this CDDL HEADER in each 14 789 ahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 789 ahrens * If applicable, add the following below this CDDL HEADER, with the 16 789 ahrens * fields enclosed by brackets "[]" replaced with your own identifying 17 789 ahrens * information: Portions Copyright [yyyy] [name of copyright owner] 18 789 ahrens * 19 789 ahrens * CDDL HEADER END 20 789 ahrens */ 21 789 ahrens /* 22 10265 Krishnendu * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 789 ahrens * Use is subject to license terms. 24 789 ahrens */ 25 789 ahrens 26 789 ahrens #ifndef ZPOOL_UTIL_H 27 789 ahrens #define ZPOOL_UTIL_H 28 789 ahrens 29 789 ahrens #include <libnvpair.h> 30 789 ahrens #include <libzfs.h> 31 789 ahrens 32 789 ahrens #ifdef __cplusplus 33 789 ahrens extern "C" { 34 789 ahrens #endif 35 789 ahrens 36 789 ahrens /* 37 789 ahrens * Basic utility functions 38 789 ahrens */ 39 789 ahrens void *safe_malloc(size_t); 40 2856 nd150628 void zpool_no_memory(void); 41 4527 perrin uint_t num_logs(nvlist_t *nv); 42 789 ahrens 43 789 ahrens /* 44 789 ahrens * Virtual device functions 45 789 ahrens */ 46 4276 taylor 47 4276 taylor nvlist_t *make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, 48 7343 Eric boolean_t isreplace, boolean_t dryrun, int argc, char **argv); 49 789 ahrens 50 789 ahrens /* 51 789 ahrens * Pool list functions 52 789 ahrens */ 53 5094 lling int for_each_pool(int, char **, boolean_t unavail, zprop_list_t **, 54 3912 lling zpool_iter_f, void *); 55 789 ahrens 56 789 ahrens typedef struct zpool_list zpool_list_t; 57 789 ahrens 58 5094 lling zpool_list_t *pool_list_get(int, char **, zprop_list_t **, int *); 59 789 ahrens void pool_list_update(zpool_list_t *); 60 789 ahrens int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *); 61 789 ahrens void pool_list_free(zpool_list_t *); 62 789 ahrens int pool_list_count(zpool_list_t *); 63 789 ahrens void pool_list_remove(zpool_list_t *, zpool_handle_t *); 64 789 ahrens 65 2082 eschrock libzfs_handle_t *g_zfs; 66 2082 eschrock 67 789 ahrens #ifdef __cplusplus 68 789 ahrens } 69 789 ahrens #endif 70 789 ahrens 71 789 ahrens #endif /* ZPOOL_UTIL_H */ 72