]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - 6/sys/geom/vinum/geom_vinum.h
merge fix for boot-time hang on centos' xen
[FreeBSD/FreeBSD.git] / 6 / sys / geom / vinum / geom_vinum.h
1 /*-
2  * Copyright (c) 2004 Lukas Ertl
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #ifndef _GEOM_VINUM_H_
30 #define _GEOM_VINUM_H_
31
32 #define ERRBUFSIZ       1024
33
34 /* geom_vinum_drive.c */
35 void    gv_config_new_drive(struct gv_drive *);
36 void    gv_drive_modify(struct gv_drive *);
37 void    gv_save_config_all(struct gv_softc *);
38 void    gv_save_config(struct g_consumer *, struct gv_drive *,
39             struct gv_softc *);
40
41 /* geom_vinum_init.c */
42 void    gv_parityop(struct g_geom *, struct gctl_req *);
43 void    gv_start_obj(struct g_geom *, struct gctl_req *);
44
45 /* geom_vinum_list.c */
46 void    gv_ld(struct g_geom *, struct gctl_req *, struct sbuf *);
47 void    gv_lp(struct g_geom *, struct gctl_req *, struct sbuf *);
48 void    gv_ls(struct g_geom *, struct gctl_req *, struct sbuf *);
49 void    gv_lv(struct g_geom *, struct gctl_req *, struct sbuf *);
50 void    gv_list(struct g_geom *, struct gctl_req *);
51
52 /* geom_vinum_move.c */
53 void    gv_move(struct g_geom *, struct gctl_req *);
54
55 /* geom_vinum_rename.c */
56 void    gv_rename(struct g_geom *, struct gctl_req *);
57
58 /* geom_vinum_rm.c */
59 void    gv_remove(struct g_geom *, struct gctl_req *);
60 int     gv_rm_sd(struct gv_softc *sc, struct gctl_req *req,
61             struct gv_sd *s, int flags);
62
63 /* geom_vinum_state.c */
64 int     gv_sdstatemap(struct gv_plex *);
65 void    gv_setstate(struct g_geom *, struct gctl_req *);
66 int     gv_set_drive_state(struct gv_drive *, int, int);
67 int     gv_set_sd_state(struct gv_sd *, int, int);
68 void    gv_update_sd_state(struct gv_sd *);
69 void    gv_update_plex_state(struct gv_plex *);
70 void    gv_update_vol_state(struct gv_volume *);
71
72 /* geom_vinum_subr.c */
73 void    gv_adjust_freespace(struct gv_sd *, off_t);
74 struct g_geom   *find_vinum_geom(void);
75 struct gv_drive *gv_find_drive(struct gv_softc *, char *);
76 struct gv_plex  *gv_find_plex(struct gv_softc *, char *);
77 struct gv_sd    *gv_find_sd(struct gv_softc *, char *);
78 struct gv_volume *gv_find_vol(struct gv_softc *, char *);
79 void    gv_format_config(struct gv_softc *, struct sbuf *, int, char *);
80 int     gv_is_striped(struct gv_plex *);
81 int     gv_is_open(struct g_geom *);
82 void    gv_kill_drive_thread(struct gv_drive *);
83 void    gv_kill_plex_thread(struct gv_plex *);
84 void    gv_kill_vol_thread(struct gv_volume *);
85 int     gv_object_type(struct gv_softc *, char *);
86 void    gv_parse_config(struct gv_softc *, u_char *, int);
87 int     gv_sd_to_drive(struct gv_softc *, struct gv_drive *, struct gv_sd *,
88             char *, int);
89 int     gv_sd_to_plex(struct gv_plex *, struct gv_sd *, int);
90 void    gv_update_plex_config(struct gv_plex *);
91 void    gv_update_vol_size(struct gv_volume *, off_t);
92
93 #endif /* !_GEOM_VINUM_H_ */