xref: /onnv-gate/usr/src/cmd/lvm/metassist/layout/layout_request.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _LAYOUT_REQUEST_H
28*0Sstevel@tonic-gate #define	_LAYOUT_REQUEST_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #ifdef __cplusplus
33*0Sstevel@tonic-gate extern "C" {
34*0Sstevel@tonic-gate #endif
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate #include "libdiskmgt.h"
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate #include "volume_dlist.h"
39*0Sstevel@tonic-gate #include "volume_defaults.h"
40*0Sstevel@tonic-gate #include "volume_devconfig.h"
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate /* XXX these are really in layout.c */
43*0Sstevel@tonic-gate extern int string_case_compare(char *str1, char *str2);
44*0Sstevel@tonic-gate extern int add_modified_disk(devconfig_t *request, dm_descriptor_t diskx);
45*0Sstevel@tonic-gate extern int add_to_hsp_list(dlist_t *devices);
46*0Sstevel@tonic-gate 
47*0Sstevel@tonic-gate extern int release_request_caches();
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate extern int set_request_diskset(char *disksset);
50*0Sstevel@tonic-gate extern char *get_request_diskset();
51*0Sstevel@tonic-gate extern void unset_request_diskset();
52*0Sstevel@tonic-gate 
53*0Sstevel@tonic-gate extern int set_toplevel_request(devconfig_t *request);
54*0Sstevel@tonic-gate extern void unset_toplevel_request();
55*0Sstevel@tonic-gate 
56*0Sstevel@tonic-gate extern int set_request_defaults(defaults_t *defaults);
57*0Sstevel@tonic-gate extern void unset_request_defaults();
58*0Sstevel@tonic-gate 
59*0Sstevel@tonic-gate extern int get_device_access_name(
60*0Sstevel@tonic-gate 	devconfig_t	*request,
61*0Sstevel@tonic-gate 	dm_descriptor_t desc,
62*0Sstevel@tonic-gate 	char		**name);
63*0Sstevel@tonic-gate 
64*0Sstevel@tonic-gate /*
65*0Sstevel@tonic-gate  * get list of HBAs, disks or slices that are available
66*0Sstevel@tonic-gate  * to satisfy the given request
67*0Sstevel@tonic-gate  */
68*0Sstevel@tonic-gate extern int slice_is_available(
69*0Sstevel@tonic-gate 	char		*name,
70*0Sstevel@tonic-gate 	devconfig_t	*request,
71*0Sstevel@tonic-gate 	boolean_t	*bool);
72*0Sstevel@tonic-gate 
73*0Sstevel@tonic-gate extern int disks_get_avail_slices(
74*0Sstevel@tonic-gate 	devconfig_t	*request,
75*0Sstevel@tonic-gate 	dlist_t		*disks,
76*0Sstevel@tonic-gate 	dlist_t		**slices);
77*0Sstevel@tonic-gate 
78*0Sstevel@tonic-gate extern int select_hbas_with_n_disks(
79*0Sstevel@tonic-gate 	devconfig_t	*request,
80*0Sstevel@tonic-gate 	dlist_t		*hbas,
81*0Sstevel@tonic-gate 	int		mindisks,
82*0Sstevel@tonic-gate 	dlist_t		**selhbas,
83*0Sstevel@tonic-gate 	dlist_t		**seldisks);
84*0Sstevel@tonic-gate 
85*0Sstevel@tonic-gate extern int hba_get_avail_disks_and_space(
86*0Sstevel@tonic-gate 	devconfig_t	*request,
87*0Sstevel@tonic-gate 	dm_descriptor_t	hba,
88*0Sstevel@tonic-gate 	dlist_t		**list,
89*0Sstevel@tonic-gate 	uint64_t	*space);
90*0Sstevel@tonic-gate 
91*0Sstevel@tonic-gate /*
92*0Sstevel@tonic-gate  * get lists of HBAs and disks that are used by volumes
93*0Sstevel@tonic-gate  */
94*0Sstevel@tonic-gate extern int get_hbas_and_disks_used_by_volumes(
95*0Sstevel@tonic-gate 	dlist_t		*volumes,
96*0Sstevel@tonic-gate 	dlist_t		**hbas,
97*0Sstevel@tonic-gate 	dlist_t		**disks);
98*0Sstevel@tonic-gate 
99*0Sstevel@tonic-gate extern int get_hbas_and_disks_used_by_volume(
100*0Sstevel@tonic-gate 	devconfig_t	*volume,
101*0Sstevel@tonic-gate 	dlist_t		**hbas,
102*0Sstevel@tonic-gate 	dlist_t		**disks);
103*0Sstevel@tonic-gate 
104*0Sstevel@tonic-gate /*
105*0Sstevel@tonic-gate  * accessors to get user-settable device parameters,
106*0Sstevel@tonic-gate  * values come from either the request or the diskset
107*0Sstevel@tonic-gate  * or global defaults
108*0Sstevel@tonic-gate  */
109*0Sstevel@tonic-gate extern int get_stripe_min_comp(
110*0Sstevel@tonic-gate 	devconfig_t	*request,
111*0Sstevel@tonic-gate 	uint16_t	*val);
112*0Sstevel@tonic-gate 
113*0Sstevel@tonic-gate extern int get_stripe_max_comp(
114*0Sstevel@tonic-gate 	devconfig_t	*request,
115*0Sstevel@tonic-gate 	uint16_t	*val);
116*0Sstevel@tonic-gate 
117*0Sstevel@tonic-gate extern int get_stripe_interlace(
118*0Sstevel@tonic-gate 	devconfig_t	*request,
119*0Sstevel@tonic-gate 	uint64_t	*val);
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate extern int get_mirror_read_strategy(
122*0Sstevel@tonic-gate 	devconfig_t	*request,
123*0Sstevel@tonic-gate 	mirror_read_strategy_t	*val);
124*0Sstevel@tonic-gate 
125*0Sstevel@tonic-gate extern int get_mirror_write_strategy(
126*0Sstevel@tonic-gate 	devconfig_t	*request,
127*0Sstevel@tonic-gate 	mirror_write_strategy_t	*val);
128*0Sstevel@tonic-gate 
129*0Sstevel@tonic-gate extern int get_mirror_pass(
130*0Sstevel@tonic-gate 	devconfig_t	*request,
131*0Sstevel@tonic-gate 	uint16_t	*val);
132*0Sstevel@tonic-gate 
133*0Sstevel@tonic-gate extern int get_mirror_nsubs(
134*0Sstevel@tonic-gate 	devconfig_t	*request,
135*0Sstevel@tonic-gate 	uint16_t	*val);
136*0Sstevel@tonic-gate 
137*0Sstevel@tonic-gate extern int get_volume_faultrecov(
138*0Sstevel@tonic-gate 	devconfig_t	*request,
139*0Sstevel@tonic-gate 	boolean_t	*val);
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate extern int get_volume_redundancy_level(
142*0Sstevel@tonic-gate 	devconfig_t	*request,
143*0Sstevel@tonic-gate 	uint16_t	*val);
144*0Sstevel@tonic-gate 
145*0Sstevel@tonic-gate extern int get_volume_npaths(
146*0Sstevel@tonic-gate 	devconfig_t	*request,
147*0Sstevel@tonic-gate 	uint16_t	*val);
148*0Sstevel@tonic-gate 
149*0Sstevel@tonic-gate extern int get_default_hsp_name(
150*0Sstevel@tonic-gate 	devconfig_t	*req,
151*0Sstevel@tonic-gate 	char		**name);
152*0Sstevel@tonic-gate 
153*0Sstevel@tonic-gate extern int get_disks_for_target(
154*0Sstevel@tonic-gate 	char		*name,
155*0Sstevel@tonic-gate 	dlist_t		**disks);
156*0Sstevel@tonic-gate 
157*0Sstevel@tonic-gate #ifdef __cplusplus
158*0Sstevel@tonic-gate }
159*0Sstevel@tonic-gate #endif
160*0Sstevel@tonic-gate 
161*0Sstevel@tonic-gate #endif /* _LAYOUT_REQUEST_H */
162