35c35
< * $FreeBSD: head/sys/geom/geom_mbr.c 93776 2002-04-04 09:54:13Z phk $
---
> * $FreeBSD: head/sys/geom/geom_mbr.c 94287 2002-04-09 15:43:32Z phk $
172c172
< int error, i, j, npart;
---
> int error, i, npart;
174a175,176
> struct g_slicer *gsp;
> u_int fwsectors, sectorsize;
177,181d178
< if (sizeof(struct dos_partition) != 16) {
< printf("WARNING: struct dos_partition compiles to %d bytes, should be 16.\n",
< (int)sizeof(struct dos_partition));
< return (NULL);
< }
186a184
> gsp = gp->softc;
193,196c191,195
< j = sizeof i;
< /* For now we only support 512 bytes sectors */
< error = g_io_getattr("GEOM::sectorsize", cp, &j, &i);
< if (!error && i != 512)
---
> error = g_getattr("GEOM::fwsectors", cp, &fwsectors);
> if (error)
> fwsectors = 17;
> error = g_getattr("GEOM::sectorsize", cp, §orsize);
> if (error)
198c197,200
< buf = g_read_data(cp, 0, 512, &error);
---
> if (!error && sectorsize != 512)
> break;
> gsp->frontstuff = sectorsize * fwsectors;
> buf = g_read_data(cp, 0, sectorsize, &error);
310c312
< int error, i, j, slice;
---
> int error, i, slice;
314a317,318
> u_int fwsectors, sectorsize;
> struct g_slicer *gsp;
322a327
> gsp = gp->softc;
328,329c333
< j = sizeof i;
< error = g_io_getattr("MBR::type", cp, &j, &i);
---
> error = g_getattr("MBR::type", cp, &i);
331a336,344
> error = g_getattr("GEOM::fwsectors", cp, &fwsectors);
> if (error)
> fwsectors = 17;
> error = g_getattr("GEOM::sectorsize", cp, §orsize);
> if (error)
> break;
> if (!error && sectorsize != 512)
> break;
> gsp->frontstuff = sectorsize * fwsectors;
333c346
< buf = g_read_data(cp, off, DEV_BSIZE, &error);
---
> buf = g_read_data(cp, off, sectorsize, &error);
< * $FreeBSD: head/sys/geom/geom_mbr.c 93776 2002-04-04 09:54:13Z phk $
---
> * $FreeBSD: head/sys/geom/geom_mbr.c 94287 2002-04-09 15:43:32Z phk $
172c172
< int error, i, j, npart;
---
> int error, i, npart;
174a175,176
> struct g_slicer *gsp;
> u_int fwsectors, sectorsize;
177,181d178
< if (sizeof(struct dos_partition) != 16) {
< printf("WARNING: struct dos_partition compiles to %d bytes, should be 16.\n",
< (int)sizeof(struct dos_partition));
< return (NULL);
< }
186a184
> gsp = gp->softc;
193,196c191,195
< j = sizeof i;
< /* For now we only support 512 bytes sectors */
< error = g_io_getattr("GEOM::sectorsize", cp, &j, &i);
< if (!error && i != 512)
---
> error = g_getattr("GEOM::fwsectors", cp, &fwsectors);
> if (error)
> fwsectors = 17;
> error = g_getattr("GEOM::sectorsize", cp, §orsize);
> if (error)
198c197,200
< buf = g_read_data(cp, 0, 512, &error);
---
> if (!error && sectorsize != 512)
> break;
> gsp->frontstuff = sectorsize * fwsectors;
> buf = g_read_data(cp, 0, sectorsize, &error);
310c312
< int error, i, j, slice;
---
> int error, i, slice;
314a317,318
> u_int fwsectors, sectorsize;
> struct g_slicer *gsp;
322a327
> gsp = gp->softc;
328,329c333
< j = sizeof i;
< error = g_io_getattr("MBR::type", cp, &j, &i);
---
> error = g_getattr("MBR::type", cp, &i);
331a336,344
> error = g_getattr("GEOM::fwsectors", cp, &fwsectors);
> if (error)
> fwsectors = 17;
> error = g_getattr("GEOM::sectorsize", cp, §orsize);
> if (error)
> break;
> if (!error && sectorsize != 512)
> break;
> gsp->frontstuff = sectorsize * fwsectors;
333c346
< buf = g_read_data(cp, off, DEV_BSIZE, &error);
---
> buf = g_read_data(cp, off, sectorsize, &error);