Deleted Added
full compact
geom.h (107453) geom.h (107953)
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 18 unchanged lines hidden (view full) ---

27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 18 unchanged lines hidden (view full) ---

27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/geom/geom.h 107453 2002-12-01 15:54:39Z phk $
35 * $FreeBSD: head/sys/geom/geom.h 107953 2002-12-16 22:33:27Z phk $
36 */
37
38#ifndef _GEOM_GEOM_H_
39#define _GEOM_GEOM_H_
40
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/sx.h>

--- 26 unchanged lines hidden (view full) ---

70#define G_TF_INSIST 1
71#define G_TF_TRANSPARENT 2
72typedef int g_access_t (struct g_provider *, int, int, int);
73/* XXX: not sure about the thread arg */
74typedef void g_orphan_t (struct g_consumer *);
75
76typedef void g_start_t (struct bio *);
77typedef void g_spoiled_t (struct g_consumer *);
36 */
37
38#ifndef _GEOM_GEOM_H_
39#define _GEOM_GEOM_H_
40
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/sx.h>

--- 26 unchanged lines hidden (view full) ---

70#define G_TF_INSIST 1
71#define G_TF_TRANSPARENT 2
72typedef int g_access_t (struct g_provider *, int, int, int);
73/* XXX: not sure about the thread arg */
74typedef void g_orphan_t (struct g_consumer *);
75
76typedef void g_start_t (struct bio *);
77typedef void g_spoiled_t (struct g_consumer *);
78typedef void g_dumpconf_t (struct sbuf *, char *indent, struct g_geom *,
78typedef void g_dumpconf_t (struct sbuf *, const char *indent, struct g_geom *,
79 struct g_consumer *, struct g_provider *);
80
81/*
82 * The g_class structure describes a transformation class. In other words
83 * all BSD disklabel handlers share one g_class, all MBR handlers share
84 * one common g_class and so on.
85 * Certain operations are instantiated on the class, most notably the
86 * taste and config_geom functions.
87 */
88struct g_class {
79 struct g_consumer *, struct g_provider *);
80
81/*
82 * The g_class structure describes a transformation class. In other words
83 * all BSD disklabel handlers share one g_class, all MBR handlers share
84 * one common g_class and so on.
85 * Certain operations are instantiated on the class, most notably the
86 * taste and config_geom functions.
87 */
88struct g_class {
89 char *name;
89 const char *name;
90 g_taste_t *taste;
91 g_config_t *config;
92 /*
93 * The remaning elements are private and classes should use
94 * the G_CLASS_INITIALIZER macro to initialize them.
95 */
96 LIST_ENTRY(g_class) class;
97 LIST_HEAD(,g_geom) geom;

--- 64 unchanged lines hidden (view full) ---

162 char *name;
163 LIST_ENTRY(g_provider) provider;
164 struct g_geom *geom;
165 LIST_HEAD(,g_consumer) consumers;
166 int acr, acw, ace;
167 int error;
168 struct g_event *event;
169 TAILQ_ENTRY(g_provider) orphan;
90 g_taste_t *taste;
91 g_config_t *config;
92 /*
93 * The remaning elements are private and classes should use
94 * the G_CLASS_INITIALIZER macro to initialize them.
95 */
96 LIST_ENTRY(g_class) class;
97 LIST_HEAD(,g_geom) geom;

--- 64 unchanged lines hidden (view full) ---

162 char *name;
163 LIST_ENTRY(g_provider) provider;
164 struct g_geom *geom;
165 LIST_HEAD(,g_consumer) consumers;
166 int acr, acw, ace;
167 int error;
168 struct g_event *event;
169 TAILQ_ENTRY(g_provider) orphan;
170 int index;
170 u_int index;
171 off_t mediasize;
172 u_int sectorsize;
173};
174
175/*
176 * This gadget is used by userland to pinpoint a particular instance of
177 * something in the kernel. The name is unreadable on purpose, people
178 * should not encounter it directly but use library functions to deal

--- 13 unchanged lines hidden (view full) ---

192 } u;
193};
194
195/* geom_dev.c */
196int g_dev_print(void);
197
198/* geom_dump.c */
199void g_hexdump(void *ptr, int length);
171 off_t mediasize;
172 u_int sectorsize;
173};
174
175/*
176 * This gadget is used by userland to pinpoint a particular instance of
177 * something in the kernel. The name is unreadable on purpose, people
178 * should not encounter it directly but use library functions to deal

--- 13 unchanged lines hidden (view full) ---

192 } u;
193};
194
195/* geom_dev.c */
196int g_dev_print(void);
197
198/* geom_dump.c */
199void g_hexdump(void *ptr, int length);
200void g_trace(int level, char *, ...);
200void g_trace(int level, const char *, ...);
201# define G_T_TOPOLOGY 1
202# define G_T_BIO 2
203# define G_T_ACCESS 4
204
205
206/* geom_event.c */
207typedef void g_call_me_t(void *);
208int g_call_me(g_call_me_t *func, void *arg);

--- 8 unchanged lines hidden (view full) ---

217int g_attach(struct g_consumer *cp, struct g_provider *pp);
218void g_destroy_consumer(struct g_consumer *cp);
219void g_destroy_geom(struct g_geom *pp);
220void g_destroy_provider(struct g_provider *pp);
221void g_detach(struct g_consumer *cp);
222void g_error_provider(struct g_provider *pp, int error);
223int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len);
224#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v))
201# define G_T_TOPOLOGY 1
202# define G_T_BIO 2
203# define G_T_ACCESS 4
204
205
206/* geom_event.c */
207typedef void g_call_me_t(void *);
208int g_call_me(g_call_me_t *func, void *arg);

--- 8 unchanged lines hidden (view full) ---

217int g_attach(struct g_consumer *cp, struct g_provider *pp);
218void g_destroy_consumer(struct g_consumer *cp);
219void g_destroy_geom(struct g_geom *pp);
220void g_destroy_provider(struct g_provider *pp);
221void g_detach(struct g_consumer *cp);
222void g_error_provider(struct g_provider *pp, int error);
223int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len);
224#define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v))
225int g_handleattr(struct bio *bp, char *attribute, void *val, int len);
226int g_handleattr_int(struct bio *bp, char *attribute, int val);
227int g_handleattr_off_t(struct bio *bp, char *attribute, off_t val);
228struct g_geom * g_insert_geom(char *class, struct g_consumer *cp);
225int g_handleattr(struct bio *bp, const char *attribute, void *val, int len);
226int g_handleattr_int(struct bio *bp, const char *attribute, int val);
227int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val);
228struct g_geom * g_insert_geom(const char *class, struct g_consumer *cp);
229struct g_consumer * g_new_consumer(struct g_geom *gp);
229struct g_consumer * g_new_consumer(struct g_geom *gp);
230struct g_geom * g_new_geomf(struct g_class *mp, char *fmt, ...);
231struct g_provider * g_new_providerf(struct g_geom *gp, char *fmt, ...);
230struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...);
231struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...);
232void g_sanity(void *ptr);
233void g_spoil(struct g_provider *pp, struct g_consumer *cp);
234int g_std_access(struct g_provider *pp, int dr, int dw, int de);
235void g_std_done(struct bio *bp);
236void g_std_spoiled(struct g_consumer *cp);
237struct g_class *g_idclass(struct geomidorname *);
238struct g_geom *g_idgeom(struct geomidorname *);
239struct g_provider *g_idprovider(struct geomidorname *);

--- 191 unchanged lines hidden ---
232void g_sanity(void *ptr);
233void g_spoil(struct g_provider *pp, struct g_consumer *cp);
234int g_std_access(struct g_provider *pp, int dr, int dw, int de);
235void g_std_done(struct bio *bp);
236void g_std_spoiled(struct g_consumer *cp);
237struct g_class *g_idclass(struct geomidorname *);
238struct g_geom *g_idgeom(struct geomidorname *);
239struct g_provider *g_idprovider(struct geomidorname *);

--- 191 unchanged lines hidden ---