2 * Copyright (c) 2003 Poul-Henning Kamp
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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 * 3. The names of the authors may not be used to endorse or promote
14 * products derived from this software without specific prior written
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 #include <sys/cdefs.h>
36 #include <sys/queue.h>
39 #include <geom/geom_ctl.h>
43 void geom_stats_close(void);
44 void geom_stats_resync(void);
45 int geom_stats_open(void);
46 void *geom_stats_snapshot_get(void);
47 void geom_stats_snapshot_free(void *);
48 void geom_stats_snapshot_timestamp(void *, struct timespec *);
49 void geom_stats_snapshot_reset(void *);
50 struct devstat *geom_stats_snapshot_next(void *);
52 char *geom_getxml(void);
57 * These structs are used to build the tree based on the XML.
58 * they're named as the kernel variant without the first '_'.
66 LIST_HEAD(gconf, gconfig);
78 LIST_HEAD(, gclass) lg_class;
79 struct gident *lg_ident;
83 LIST_ENTRY(gconfig) lg_config;
91 LIST_ENTRY(gclass) lg_class;
92 LIST_HEAD(, ggeom) lg_geom;
93 struct gconf lg_config;
98 struct gclass *lg_class;
101 LIST_ENTRY(ggeom) lg_geom;
102 LIST_HEAD(, gconsumer) lg_consumer;
103 LIST_HEAD(, gprovider) lg_provider;
104 struct gconf lg_config;
109 struct ggeom *lg_geom;
110 LIST_ENTRY(gconsumer) lg_consumer;
111 struct gprovider *lg_provider;
112 LIST_ENTRY(gconsumer) lg_consumers;
114 struct gconf lg_config;
120 struct ggeom *lg_geom;
121 LIST_ENTRY(gprovider) lg_provider;
122 LIST_HEAD(, gconsumer) lg_consumers;
126 struct gconf lg_config;
129 struct gident * geom_lookupid(struct gmesh *, const void *);
130 int geom_xml2tree(struct gmesh *, char *);
131 int geom_gettree(struct gmesh *);
132 void geom_deletetree(struct gmesh *);
138 #ifdef _STDIO_H_ /* limit #include pollution */
139 void gctl_dump(struct gctl_req *, FILE *);
141 void gctl_free(struct gctl_req *);
142 struct gctl_req *gctl_get_handle(void);
143 const char *gctl_issue(struct gctl_req *);
144 void gctl_ro_param(struct gctl_req *, const char *, int, const void *);
145 void gctl_rw_param(struct gctl_req *, const char *, int, void *);
148 int g_open(const char *, int);
150 off_t g_mediasize(int);
151 ssize_t g_sectorsize(int);
153 int g_delete(int, off_t, off_t);
154 int g_get_ident(int, char *, size_t);
155 int g_get_name(const char *, char *, size_t);
156 int g_open_by_ident(const char *, int, char *, size_t);
157 char *g_device_path(const char *);
158 char *g_providername(int);
162 #endif /* _LIBGEOM_H_ */