xref: /freebsd/sys/geom/geom_int.h (revision 732a02b4e77866604a120a275c082bb6221bd2ff)
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  * $FreeBSD$
38  */
39 
40 LIST_HEAD(class_list_head, g_class);
41 TAILQ_HEAD(g_tailq_head, g_geom);
42 
43 extern int g_collectstats;
44 #define G_STATS_PROVIDERS	1	/* Collect I/O stats for providers */
45 #define G_STATS_CONSUMERS	2	/* Collect I/O stats for consumers */
46 
47 /* geom_dump.c */
48 void g_confxml(void *, int flag);
49 void g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp);
50 void g_conf_cat_escaped(struct sbuf *sb, const char *buf);
51 void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...);
52 void g_confdot(void *, int flag);
53 void g_conftxt(void *, int flag);
54 
55 /* geom_event.c */
56 void g_event_init(void);
57 void g_run_events(void);
58 void g_do_wither(void);
59 
60 /* geom_subr.c */
61 extern struct class_list_head g_classes;
62 extern char *g_wait_event, *g_wait_sim, *g_wait_up, *g_wait_down;
63 void g_wither_washer(void);
64 
65 /* geom_io.c */
66 void g_io_init(void);
67 void g_io_schedule_down(struct thread *tp);
68 void g_io_schedule_up(struct thread *tp);
69 
70 /* geom_kern.c / geom_kernsim.c */
71 void g_init(void);
72 extern int g_shutdown;
73 extern int g_notaste;
74 
75 /* geom_ctl.c */
76 void g_ctl_init(void);
77