Deleted Added
full compact
geom_mbr.c (106397) geom_mbr.c (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

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

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
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

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

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/geom/geom_mbr.c 106397 2002-11-04 06:29:05Z phk $
32 * $FreeBSD: head/sys/geom/geom_mbr.c 107953 2002-12-16 22:33:27Z phk $
33 */
34
35#include <sys/param.h>
36#ifndef _KERNEL
37#include <stdio.h>
38#include <string.h>
39#include <signal.h>
40#include <sys/param.h>

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

98
99static int
100g_mbr_start(struct bio *bp)
101{
102 struct g_provider *pp;
103 struct g_geom *gp;
104 struct g_mbr_softc *mp;
105 struct g_slicer *gsp;
33 */
34
35#include <sys/param.h>
36#ifndef _KERNEL
37#include <stdio.h>
38#include <string.h>
39#include <signal.h>
40#include <sys/param.h>

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

98
99static int
100g_mbr_start(struct bio *bp)
101{
102 struct g_provider *pp;
103 struct g_geom *gp;
104 struct g_mbr_softc *mp;
105 struct g_slicer *gsp;
106 int index;
106 int idx;
107
108 pp = bp->bio_to;
107
108 pp = bp->bio_to;
109 index = pp->index;
109 idx = pp->index;
110 gp = pp->geom;
111 gsp = gp->softc;
112 mp = gsp->softc;
113 if (bp->bio_cmd == BIO_GETATTR) {
110 gp = pp->geom;
111 gsp = gp->softc;
112 mp = gsp->softc;
113 if (bp->bio_cmd == BIO_GETATTR) {
114 if (g_handleattr_int(bp, "MBR::type", mp->type[index]))
114 if (g_handleattr_int(bp, "MBR::type", mp->type[idx]))
115 return (1);
116 if (g_handleattr_off_t(bp, "MBR::offset",
115 return (1);
116 if (g_handleattr_off_t(bp, "MBR::offset",
117 gsp->slices[index].offset))
117 gsp->slices[idx].offset))
118 return (1);
119 }
120 return (0);
121}
122
123static void
118 return (1);
119 }
120 return (0);
121}
122
123static void
124g_mbr_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
124g_mbr_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
125{
126 struct g_mbr_softc *mp;
127 struct g_slicer *gsp;
128
129 gsp = gp->softc;
130 mp = gsp->softc;
131 g_slice_dumpconf(sb, indent, gp, cp, pp);
132 if (pp != NULL) {

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

284
285static int
286g_mbrext_start(struct bio *bp)
287{
288 struct g_provider *pp;
289 struct g_geom *gp;
290 struct g_mbrext_softc *mp;
291 struct g_slicer *gsp;
125{
126 struct g_mbr_softc *mp;
127 struct g_slicer *gsp;
128
129 gsp = gp->softc;
130 mp = gsp->softc;
131 g_slice_dumpconf(sb, indent, gp, cp, pp);
132 if (pp != NULL) {

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

284
285static int
286g_mbrext_start(struct bio *bp)
287{
288 struct g_provider *pp;
289 struct g_geom *gp;
290 struct g_mbrext_softc *mp;
291 struct g_slicer *gsp;
292 int index;
292 int idx;
293
294 pp = bp->bio_to;
293
294 pp = bp->bio_to;
295 index = pp->index;
295 idx = pp->index;
296 gp = pp->geom;
297 gsp = gp->softc;
298 mp = gsp->softc;
299 if (bp->bio_cmd == BIO_GETATTR) {
296 gp = pp->geom;
297 gsp = gp->softc;
298 mp = gsp->softc;
299 if (bp->bio_cmd == BIO_GETATTR) {
300 if (g_handleattr_int(bp, "MBR::type", mp->type[index]))
300 if (g_handleattr_int(bp, "MBR::type", mp->type[idx]))
301 return (1);
302 }
303 return (0);
304}
305
306static void
301 return (1);
302 }
303 return (0);
304}
305
306static void
307g_mbrext_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
307g_mbrext_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
308{
309 struct g_mbrext_softc *mp;
310 struct g_slicer *gsp;
311
312 g_slice_dumpconf(sb, indent, gp, cp, pp);
313 gsp = gp->softc;
314 mp = gsp->softc;
315 if (pp != NULL) {

--- 108 unchanged lines hidden ---
308{
309 struct g_mbrext_softc *mp;
310 struct g_slicer *gsp;
311
312 g_slice_dumpconf(sb, indent, gp, cp, pp);
313 gsp = gp->softc;
314 mp = gsp->softc;
315 if (pp != NULL) {

--- 108 unchanged lines hidden ---