xref: /freebsd/sys/geom/geom_int.h (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright (c) 2002 Poul-Henning Kamp
5  * Copyright (c) 2002 Networks Associates Technology, Inc.
6  * All rights reserved.
7  *
8  * This software was developed for the FreeBSD Project by Poul-Henning Kamp
9  * and NAI Labs, the Security Research Division of Network Associates, Inc.
10  * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
11  * DARPA CHATS research program.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. The names of the authors may not be used to endorse or promote
22  *    products derived from this software without specific prior written
23  *    permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  */
37 
38 LIST_HEAD(class_list_head, g_class);
39 TAILQ_HEAD(g_tailq_head, g_geom);
40 
41 extern int g_collectstats;
42 #define G_STATS_PROVIDERS	1	/* Collect I/O stats for providers */
43 #define G_STATS_CONSUMERS	2	/* Collect I/O stats for consumers */
44 
45 /* geom_dump.c */
46 void g_confxml(void *, int flag);
47 void g_conf_specific(struct sbuf *sb, struct g_geom **gps);
48 void g_conf_cat_escaped(struct sbuf *sb, const char *buf);
49 void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...);
50 void g_confdot(void *, int flag);
51 void g_conftxt(void *, int flag);
52 
53 /* geom_event.c */
54 void g_event_init(void);
55 void g_run_events(void);
56 void g_do_wither(void);
57 
58 /* geom_subr.c */
59 extern struct class_list_head g_classes;
60 extern char *g_wait_event, *g_wait_up, *g_wait_down;
61 void g_wither_washer(void);
62 
63 /* geom_io.c */
64 void g_io_init(void);
65 void g_io_schedule_down(struct thread *tp);
66 void g_io_schedule_up(struct thread *tp);
67 
68 /* geom_kern.c / geom_kernsim.c */
69 void g_init(void);
70 extern struct thread *g_up_td;
71 extern struct thread *g_down_td;
72 extern int g_shutdown;
73 extern int g_notaste;
74 
75 /* geom_ctl.c */
76 void g_ctl_init(void);
77