xref: /titanic_41/usr/src/cmd/lvm/metassist/layout/layout_request.h (revision 7a286c471efbab8562f7655a82931904703fffe0)
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 _LAYOUT_REQUEST_H
28 #define	_LAYOUT_REQUEST_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include "libdiskmgt.h"
37 
38 #include "volume_dlist.h"
39 #include "volume_defaults.h"
40 #include "volume_devconfig.h"
41 
42 /* XXX these are really in layout.c */
43 extern int string_case_compare(char *str1, char *str2);
44 extern int add_modified_disk(devconfig_t *request, dm_descriptor_t diskx);
45 extern int add_to_hsp_list(dlist_t *devices);
46 
47 extern int release_request_caches();
48 
49 extern int set_request_diskset(char *disksset);
50 extern char *get_request_diskset();
51 extern void unset_request_diskset();
52 
53 extern int set_toplevel_request(devconfig_t *request);
54 extern void unset_toplevel_request();
55 
56 extern int set_request_defaults(defaults_t *defaults);
57 extern void unset_request_defaults();
58 
59 extern int get_device_access_name(
60 	devconfig_t	*request,
61 	dm_descriptor_t desc,
62 	char		**name);
63 
64 /*
65  * get list of HBAs, disks or slices that are available
66  * to satisfy the given request
67  */
68 extern int slice_is_available(
69 	char		*name,
70 	devconfig_t	*request,
71 	boolean_t	*bool);
72 
73 extern int disks_get_avail_slices(
74 	devconfig_t	*request,
75 	dlist_t		*disks,
76 	dlist_t		**slices);
77 
78 extern int select_hbas_with_n_disks(
79 	devconfig_t	*request,
80 	dlist_t		*hbas,
81 	int		mindisks,
82 	dlist_t		**selhbas,
83 	dlist_t		**seldisks);
84 
85 extern int hba_get_avail_disks_and_space(
86 	devconfig_t	*request,
87 	dm_descriptor_t	hba,
88 	dlist_t		**list,
89 	uint64_t	*space);
90 
91 /*
92  * get lists of HBAs and disks that are used by volumes
93  */
94 extern int get_hbas_and_disks_used_by_volumes(
95 	dlist_t		*volumes,
96 	dlist_t		**hbas,
97 	dlist_t		**disks);
98 
99 extern int get_hbas_and_disks_used_by_volume(
100 	devconfig_t	*volume,
101 	dlist_t		**hbas,
102 	dlist_t		**disks);
103 
104 /*
105  * accessors to get user-settable device parameters,
106  * values come from either the request or the diskset
107  * or global defaults
108  */
109 extern int get_stripe_min_comp(
110 	devconfig_t	*request,
111 	uint16_t	*val);
112 
113 extern int get_stripe_max_comp(
114 	devconfig_t	*request,
115 	uint16_t	*val);
116 
117 extern int get_stripe_interlace(
118 	devconfig_t	*request,
119 	uint64_t	*val);
120 
121 extern int get_mirror_read_strategy(
122 	devconfig_t	*request,
123 	mirror_read_strategy_t	*val);
124 
125 extern int get_mirror_write_strategy(
126 	devconfig_t	*request,
127 	mirror_write_strategy_t	*val);
128 
129 extern int get_mirror_pass(
130 	devconfig_t	*request,
131 	uint16_t	*val);
132 
133 extern int get_mirror_nsubs(
134 	devconfig_t	*request,
135 	uint16_t	*val);
136 
137 extern int get_volume_faultrecov(
138 	devconfig_t	*request,
139 	boolean_t	*val);
140 
141 extern int get_volume_redundancy_level(
142 	devconfig_t	*request,
143 	uint16_t	*val);
144 
145 extern int get_volume_npaths(
146 	devconfig_t	*request,
147 	uint16_t	*val);
148 
149 extern int get_default_hsp_name(
150 	devconfig_t	*req,
151 	char		**name);
152 
153 extern int get_disks_for_target(
154 	char		*name,
155 	dlist_t		**disks);
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* _LAYOUT_REQUEST_H */
162