Retire the "frontstuff" record keeping, it was no match for the

in-band meta-data of BSD labels and a more complex solution will be needed.
This commit is contained in:
Poul-Henning Kamp 2003-04-12 08:41:26 +00:00
parent 6e03422af0
commit 0d3e96e39c
8 changed files with 1 additions and 38 deletions

View File

@ -178,12 +178,6 @@ g_apple_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (sectorsize != 512)
break;
/*
* Reserve the driver record. XXX Should the partition
* map be included ?
*/
gsp->frontstuff = sectorsize;
buf = g_read_data(cp, 0, sectorsize, &error);
if (buf == NULL || error != 0)
break;

View File

@ -462,7 +462,6 @@ g_bsd_try(struct g_geom *gp, struct g_slicer *gsp, struct g_consumer *cp, int se
/* If we had a label, record it properly. */
if (error == 0) {
gsp->frontstuff = 16 * secsize; /* XXX */
ms->labeloffset = offset;
g_topology_lock();
g_slice_conf_hot(gp, 0, offset, g_bsd_ondisk_size());

View File

@ -209,9 +209,6 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist)
tblsz = (hdr->hdr_entries * hdr->hdr_entsz + secsz - 1) &
~(secsz - 1);
buf = g_read_data(cp, hdr->hdr_lba_table * secsz, tblsz, &error);
gsp->frontstuff = hdr->hdr_lba_start * secsz;
for (i = 0; i < hdr->hdr_entries; i++) {
struct uuid unused = GPT_ENT_TYPE_UNUSED;
struct uuid freebsd = GPT_ENT_TYPE_FREEBSD;

View File

@ -297,7 +297,6 @@ g_mbr_taste(struct g_class *mp, struct g_provider *pp, int insist)
if (sectorsize < 512)
break;
ms->sectorsize = sectorsize;
gsp->frontstuff = sectorsize * fwsectors;
buf = g_read_data(cp, 0, sectorsize, &error);
if (buf == NULL || error != 0)
break;
@ -404,7 +403,6 @@ g_mbrext_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
sectorsize = cp->provider->sectorsize;
if (sectorsize != 512)
break;
gsp->frontstuff = sectorsize * fwsectors;
for (;;) {
buf = g_read_data(cp, off, sectorsize, &error);
if (buf == NULL || error != 0)

View File

@ -328,7 +328,6 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
sectorsize = cp->provider->sectorsize;
if (sectorsize < 512)
break;
gsp->frontstuff = sectorsize * fwsectors;
buf = g_read_data(cp, 0, 8192, &error);
if (buf == NULL || error != 0)
break;

View File

@ -220,18 +220,6 @@ g_slice_start(struct bio *bp)
/* Give the real method a chance to override */
if (gsp->start(bp))
return;
if (!strcmp("GEOM::frontstuff", bp->bio_attribute)) {
t = gsp->cfrontstuff;
if (gsp->frontstuff > t)
t = gsp->frontstuff;
t -= gsl->offset;
if (t < 0)
t = 0;
if (t > gsl->length)
t = gsl->length;
g_handleattr_off_t(bp, "GEOM::frontstuff", t);
return;
}
#ifdef _KERNEL
if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) {
struct g_kerneldump *gkd;
@ -269,10 +257,6 @@ g_slice_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct
(uintmax_t)gsp->slices[pp->index].offset);
return;
}
if (gp != NULL && (pp == NULL && cp == NULL)) {
sbuf_printf(sb, "%s<frontstuff>%ju</frontstuff>\n",
indent, (intmax_t)gsp->frontstuff);
}
if (pp != NULL) {
sbuf_printf(sb, "%s<index>%u</index>\n", indent, pp->index);
sbuf_printf(sb, "%s<length>%ju</length>\n",
@ -400,7 +384,7 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co
struct g_slicer *gsp;
struct g_consumer *cp;
void **vp;
int error, i;
int error;
g_topology_assert();
vp = (void **)extrap;
@ -426,11 +410,6 @@ g_slice_new(struct g_class *mp, u_int slices, struct g_provider *pp, struct g_co
g_destroy_geom(gp);
return (NULL);
}
/* Find out if there are any magic bytes on the consumer */
i = sizeof gsp->cfrontstuff;
error = g_io_getattr("GEOM::frontstuff", cp, &i, &gsp->cfrontstuff);
if (error)
gsp->cfrontstuff = 0;
*vp = gsp->softc;
*cpp = cp;
return (gp);

View File

@ -51,8 +51,6 @@ struct g_slicer {
u_int nslice;
u_int nprovider;
u_int nhot;
off_t cfrontstuff;
off_t frontstuff;
struct g_slice *slices;
struct g_slice *hot;
void *softc;

View File

@ -174,7 +174,6 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags)
ms->sectorsize = cp->provider->sectorsize;
if (ms->sectorsize < 512)
break;
gsp->frontstuff = 16 * ms->sectorsize;
mediasize = cp->provider->mediasize;
buf = g_read_data(cp, 0, ms->sectorsize, &error);
if (buf == NULL || error != 0)