1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
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 2003 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef _VOLUME_SVM_UTIL_H
28#define	_VOLUME_SVM_UTIL_H
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#include "volume_devconfig.h"
37
38/*
39 * scan existing SVM config for the named diskset
40 * and build lists of device, HSP and diskset names.
41 */
42extern int		scan_svm_names(char *diskset);
43extern void		release_svm_names();
44
45extern int		hsp_get_default_for_diskset(char *diskset,
46	devconfig_t **hsp);
47extern int		hsp_get_by_name(char *diskset, char *hspname,
48	devconfig_t **hsp);
49
50extern int		get_next_volume_name(char **name,
51	component_type_t type);
52extern int		get_next_hsp_name(char **name);
53extern int		get_next_submirror_name(char *mname, char **subname);
54
55extern int		reserve_volume_name(char *name);
56extern int		reserve_hsp_name(char *name);
57
58extern void		release_volume_name(char *name);
59extern void		release_hsp_name(char *name);
60
61extern boolean_t	is_volume_name_valid(char *name);
62extern boolean_t	is_hsp_name_valid(char *name);
63
64extern boolean_t	is_volume_name_in_range(char *name);
65
66extern int get_disks_in_diskset(char *dsname, dlist_t **disks);
67
68extern int		is_disk_in_diskset(
69	dm_descriptor_t disk, char *diskset, boolean_t *bool);
70extern int		is_disk_in_other_diskset(
71	dm_descriptor_t disk, char *diskset, boolean_t *bool);
72
73extern boolean_t	diskset_exists(char *name);
74extern uint64_t		get_default_stripe_interlace();
75
76extern int		get_n_metadb_replicas(int *nreplicas);
77extern int		get_max_number_of_devices(int *max);
78extern int		get_max_number_of_disksets(int *max);
79
80extern int		is_reserved_replica_slice_index(
81	char *diskset, char *dname, uint32_t index, boolean_t *bool);
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* _VOLUME_SVM_UTIL_H */
88