Deleted Added
full compact
geom_bsd.c (92108) geom_bsd.c (92403)
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_bsd.c 92108 2002-03-11 21:42:35Z phk $
35 * $FreeBSD: head/sys/geom/geom_bsd.c 92403 2002-03-16 09:24:19Z phk $
36 */
37
38
39#include <sys/param.h>
40#ifndef _KERNEL
41#include <stdio.h>
42#include <string.h>
43#include <stdlib.h>

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

84
85static int
86g_bsd_start(struct bio *bp)
87{
88 struct g_geom *gp;
89 struct g_bsd_softc *ms;
90 struct g_slicer *gsp;
91 struct partinfo pi;
36 */
37
38
39#include <sys/param.h>
40#ifndef _KERNEL
41#include <stdio.h>
42#include <string.h>
43#include <stdlib.h>

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

84
85static int
86g_bsd_start(struct bio *bp)
87{
88 struct g_geom *gp;
89 struct g_bsd_softc *ms;
90 struct g_slicer *gsp;
91 struct partinfo pi;
92 struct g_ioctl *gio;
92
93 gp = bp->bio_to->geom;
94 gsp = gp->softc;
95 ms = gsp->softc;
93
94 gp = bp->bio_to->geom;
95 gsp = gp->softc;
96 ms = gsp->softc;
97#if 0
96 if (g_haveattr(bp, "IOCTL::DIOCGDINFO",
97 &ms->inram,
98 sizeof ms->inram))
99 return (1);
98 if (g_haveattr(bp, "IOCTL::DIOCGDINFO",
99 &ms->inram,
100 sizeof ms->inram))
101 return (1);
100 if (!strcmp(bp->bio_attribute, "IOCTL::DIOCGPART")) {
102 else if (!strcmp(bp->bio_attribute, "IOCTL::DIOCGPART")) {
101 pi.disklab = &ms->inram;
102 pi.part = &ms->inram.d_partitions[bp->bio_to->index];
103 if (g_haveattr(bp, "IOCTL::DIOCGPART", &pi, sizeof pi))
104 return (1);
105 }
103 pi.disklab = &ms->inram;
104 pi.part = &ms->inram.d_partitions[bp->bio_to->index];
105 if (g_haveattr(bp, "IOCTL::DIOCGPART", &pi, sizeof pi))
106 return (1);
107 }
108#endif
109 if (strcmp(bp->bio_attribute, "GEOM::ioctl"))
110 return(0);
111 else if (bp->bio_length != sizeof *gio)
112 return(0);
113 gio = (struct g_ioctl *)bp->bio_data;
114 if (gio->cmd == DIOCGDINFO) {
115 bcopy(&ms->inram, gio->data, sizeof ms->inram);
116 bp->bio_error = 0;
117 g_io_deliver(bp);
118 return (1);
119 }
120 if (gio->cmd == DIOCGPART) {
121 pi.disklab = &ms->inram;
122 pi.part = &ms->inram.d_partitions[bp->bio_to->index];
123 bcopy(&pi, gio->data, sizeof pi);
124 bp->bio_error = 0;
125 g_io_deliver(bp);
126 return (1);
127 }
106 return (0);
107}
108
109static void
110g_bsd_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
111{
112#if 0
113 struct g_mbr_softc *ms;

--- 144 unchanged lines hidden ---
128 return (0);
129}
130
131static void
132g_bsd_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
133{
134#if 0
135 struct g_mbr_softc *ms;

--- 144 unchanged lines hidden ---