Deleted Added
full compact
geom.h (93250) geom.h (93776)
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 93250 2002-03-26 22:07:38Z phk $
35 * $FreeBSD: head/sys/geom/geom.h 93776 2002-04-04 09:54:13Z phk $
36 */
37
38#include <sys/lock.h>
39#include <sys/mutex.h>
40#include <sys/sx.h>
41#include <sys/queue.h>
42
43#ifndef _KERNEL

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

52struct g_geom;
53struct g_consumer;
54struct g_provider;
55struct g_event;
56struct thread;
57struct bio;
58struct sbuf;
59
36 */
37
38#include <sys/lock.h>
39#include <sys/mutex.h>
40#include <sys/sx.h>
41#include <sys/queue.h>
42
43#ifndef _KERNEL

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

52struct g_geom;
53struct g_consumer;
54struct g_provider;
55struct g_event;
56struct thread;
57struct bio;
58struct sbuf;
59
60#define G_CLASS_INITSTUFF { 0, 0 }, { 0 }, 0
61
62typedef struct g_geom * g_create_geom_t (struct g_class *mp,
63 struct g_provider *pp, char *name);
64typedef struct g_geom * g_taste_t (struct g_class *, struct g_provider *,
65 int flags);
66#define G_TF_NORMAL 0
67#define G_TF_INSIST 1
68#define G_TF_TRANSPARENT 2

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

76 struct g_consumer *, struct g_provider *);
77
78/*
79 * The g_class structure describes a transformation class. In other words
80 * all BSD disklabel handlers share one g_class, all MBR handlers share
81 * one common g_class and so on.
82 * Certain operations are instantiated on the class, most notably the
83 * taste and create_geom functions.
60
61typedef struct g_geom * g_create_geom_t (struct g_class *mp,
62 struct g_provider *pp, char *name);
63typedef struct g_geom * g_taste_t (struct g_class *, struct g_provider *,
64 int flags);
65#define G_TF_NORMAL 0
66#define G_TF_INSIST 1
67#define G_TF_TRANSPARENT 2

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

75 struct g_consumer *, struct g_provider *);
76
77/*
78 * The g_class structure describes a transformation class. In other words
79 * all BSD disklabel handlers share one g_class, all MBR handlers share
80 * one common g_class and so on.
81 * Certain operations are instantiated on the class, most notably the
82 * taste and create_geom functions.
84 * XXX: should access and orphan go into g_geom ?
85 * XXX: would g_class be a better and less confusing name ?
86 */
87struct g_class {
88 char *name;
89 g_taste_t *taste;
83 */
84struct g_class {
85 char *name;
86 g_taste_t *taste;
90 g_access_t *access;
91 g_orphan_t *orphan;
92 g_create_geom_t *create_geom;
87 g_create_geom_t *create_geom;
88 /*
89 * The remaning elements are private and classes should use
90 * the G_CLASS_INITSTUFF macro to initialize them.
91 */
93 LIST_ENTRY(g_class) class;
94 LIST_HEAD(,g_geom) geom;
95 struct g_event *event;
96};
97
92 LIST_ENTRY(g_class) class;
93 LIST_HEAD(,g_geom) geom;
94 struct g_event *event;
95};
96
97#define G_CLASS_INITSTUFF { 0, 0 }, { 0 }, 0
98
98/*
99 * The g_geom is an instance of a g_class.
100 */
101struct g_geom {
102 char *name;
103 struct g_class *class;
104 LIST_ENTRY(g_geom) geom;
105 LIST_HEAD(,g_consumer) consumer;
106 LIST_HEAD(,g_provider) provider;
107 TAILQ_ENTRY(g_geom) geoms; /* XXX: better name */
108 int rank;
109 g_start_t *start;
110 g_spoiled_t *spoiled;
111 g_dumpconf_t *dumpconf;
99/*
100 * The g_geom is an instance of a g_class.
101 */
102struct g_geom {
103 char *name;
104 struct g_class *class;
105 LIST_ENTRY(g_geom) geom;
106 LIST_HEAD(,g_consumer) consumer;
107 LIST_HEAD(,g_provider) provider;
108 TAILQ_ENTRY(g_geom) geoms; /* XXX: better name */
109 int rank;
110 g_start_t *start;
111 g_spoiled_t *spoiled;
112 g_dumpconf_t *dumpconf;
113 g_access_t *access;
114 g_orphan_t *orphan;
112 void *softc;
113 struct g_event *event;
114 unsigned flags;
115#define G_GEOM_WITHER 1
116};
117
118/*
119 * The g_bioq is a queue of struct bio's.

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

200int g_std_access(struct g_provider *pp, int dr, int dw, int de);
201void g_std_done(struct bio *bp);
202void g_std_spoiled(struct g_consumer *cp);
203
204/* geom_io.c */
205struct bio * g_clone_bio(struct bio *);
206void g_destroy_bio(struct bio *);
207void g_io_deliver(struct bio *bp);
115 void *softc;
116 struct g_event *event;
117 unsigned flags;
118#define G_GEOM_WITHER 1
119};
120
121/*
122 * The g_bioq is a queue of struct bio's.

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

203int g_std_access(struct g_provider *pp, int dr, int dw, int de);
204void g_std_done(struct bio *bp);
205void g_std_spoiled(struct g_consumer *cp);
206
207/* geom_io.c */
208struct bio * g_clone_bio(struct bio *);
209void g_destroy_bio(struct bio *);
210void g_io_deliver(struct bio *bp);
211void g_io_fail(struct bio *bp, int error);
208int g_io_getattr(char *attr, struct g_consumer *cp, int *len, void *ptr);
209void g_io_request(struct bio *bp, struct g_consumer *cp);
210int g_io_setattr(char *attr, struct g_consumer *cp, int len, void *ptr);
211struct bio *g_new_bio(void);
212void * g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error);
213
214/* geom_kern.c / geom_kernsim.c */
215

--- 47 unchanged lines hidden ---
212int g_io_getattr(char *attr, struct g_consumer *cp, int *len, void *ptr);
213void g_io_request(struct bio *bp, struct g_consumer *cp);
214int g_io_setattr(char *attr, struct g_consumer *cp, int len, void *ptr);
215struct bio *g_new_bio(void);
216void * g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error);
217
218/* geom_kern.c / geom_kernsim.c */
219

--- 47 unchanged lines hidden ---