diff options
author | phk <phk@FreeBSD.org> | 2002-12-13 21:31:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-12-13 21:31:13 +0000 |
commit | 43d82ce26df81c3c077b619993e4ee9fb6a999c4 (patch) | |
tree | c1addbd65ec26f7c65bcbaf2e691d7f1cfa92a26 | |
parent | 39fb253bb1358ff4e6ad2deaf867a0f22341574c (diff) | |
download | FreeBSD-src-43d82ce26df81c3c077b619993e4ee9fb6a999c4.zip FreeBSD-src-43d82ce26df81c3c077b619993e4ee9fb6a999c4.tar.gz |
Don't interpret the hotspots relative to all slices on a slicer, but
relative to the parent device.
-rw-r--r-- | sys/geom/geom_bsd.c | 5 | ||||
-rw-r--r-- | sys/geom/geom_slice.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c index f44eb76..a711bbc 100644 --- a/sys/geom/geom_bsd.c +++ b/sys/geom/geom_bsd.c @@ -555,6 +555,7 @@ g_bsd_hotwrite(void *arg) struct bio *bp; struct g_geom *gp; struct g_slicer *gsp; + struct g_slice *gsl; struct g_bsd_softc *ms; struct g_bsd_softc fake; u_char *p; @@ -564,7 +565,9 @@ g_bsd_hotwrite(void *arg) gp = bp->bio_to->geom; gsp = gp->softc; ms = gsp->softc; - p = bp->bio_data + ms->labeloffset - bp->bio_offset; + gsl = &gsp->slices[bp->bio_to->index]; + p = bp->bio_data + ms->labeloffset + - (bp->bio_offset + gsl->offset); g_bsd_ledec_disklabel(p, &fake.ondisk); ondisk2inram(&fake); diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 8bcf52c..82df9fb 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -184,11 +184,12 @@ g_slice_start(struct bio *bp) * Check if we collide with any hot spaces, and call the * method once if so. */ + t = bp->bio_offset + gsl->offset; for (m_index = 0; m_index < gsp->nhot; m_index++) { gmp = &gsp->hot[m_index]; - if (bp->bio_offset >= gmp->offset + gmp->length) + if (t >= gmp->offset + gmp->length) continue; - if (bp->bio_offset + bp->bio_length <= gmp->offset) + if (t + bp->bio_length <= gmp->offset) continue; error = gsp->start(bp); if (error == EJUSTRETURN) |