Deleted Added
full compact
geom_dev.c (130712) geom_dev.c (133314)
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

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

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
36#include <sys/cdefs.h>
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

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

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
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/geom/geom_dev.c 130712 2004-06-19 09:00:53Z phk $");
37__FBSDID("$FreeBSD: head/sys/geom/geom_dev.c 133314 2004-08-08 06:49:07Z phk $");
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>
42#include <sys/kernel.h>
43#include <sys/conf.h>
44#include <sys/bio.h>
45#include <sys/lock.h>

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

72};
73
74static g_taste_t g_dev_taste;
75static g_orphan_t g_dev_orphan;
76
77static struct g_class g_dev_class = {
78 .name = "DEV",
79 .taste = g_dev_taste,
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>
42#include <sys/kernel.h>
43#include <sys/conf.h>
44#include <sys/bio.h>
45#include <sys/lock.h>

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

72};
73
74static g_taste_t g_dev_taste;
75static g_orphan_t g_dev_orphan;
76
77static struct g_class g_dev_class = {
78 .name = "DEV",
79 .taste = g_dev_taste,
80 .orphan = g_dev_orphan,
80};
81
82void
83g_dev_print(void)
84{
85 struct g_geom *gp;
86 char const *p = "";
87

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

116 struct cdev *dev;
117
118 g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
119 g_topology_assert();
120 LIST_FOREACH(cp, &pp->consumers, consumers)
121 if (cp->geom->class == mp)
122 return (NULL);
123 gp = g_new_geomf(mp, pp->name);
81};
82
83void
84g_dev_print(void)
85{
86 struct g_geom *gp;
87 char const *p = "";
88

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

117 struct cdev *dev;
118
119 g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
120 g_topology_assert();
121 LIST_FOREACH(cp, &pp->consumers, consumers)
122 if (cp->geom->class == mp)
123 return (NULL);
124 gp = g_new_geomf(mp, pp->name);
124 gp->orphan = g_dev_orphan;
125 cp = g_new_consumer(gp);
126 error = g_attach(cp, pp);
127 KASSERT(error == 0,
128 ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error));
129 /*
130 * XXX: I'm not 100% sure we can call make_dev(9) without Giant
131 * yet. Once we can, we don't need to drop topology here either.
132 */

--- 281 unchanged lines hidden ---
125 cp = g_new_consumer(gp);
126 error = g_attach(cp, pp);
127 KASSERT(error == 0,
128 ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error));
129 /*
130 * XXX: I'm not 100% sure we can call make_dev(9) without Giant
131 * yet. Once we can, we don't need to drop topology here either.
132 */

--- 281 unchanged lines hidden ---