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