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