diff options
author | mav <mav@FreeBSD.org> | 2013-03-26 07:55:24 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-03-26 07:55:24 +0000 |
commit | babac8c981987b661a0f189103f3e87573fcc818 (patch) | |
tree | 58515b69ed0700a94aeb0d09e59c4b7159a301fb /sys/geom/geom_slice.c | |
parent | 9856e081034a138d1d8fbba263279e25e63a0770 (diff) | |
download | FreeBSD-src-babac8c981987b661a0f189103f3e87573fcc818.zip FreeBSD-src-babac8c981987b661a0f189103f3e87573fcc818.tar.gz |
geom_slice.c and its consumers like GEOM_LABEL are not touching the data
unless hotspots are used. Pass G_PF_ACCEPT_UNMAPPED flag through except
such rare cases (obsolete GEOM_SUNLABEL and GEOM_BSD).
Diffstat (limited to 'sys/geom/geom_slice.c')
-rw-r--r-- | sys/geom/geom_slice.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index ddab089..0f12a0a 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -396,6 +396,8 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length pp->stripeoffset = pp2->stripeoffset + offset; if (pp->stripesize > 0) pp->stripeoffset %= pp->stripesize; + if (gsp->nhotspot == 0) + pp->flags |= pp2->flags & G_PF_ACCEPT_UNMAPPED; if (0 && bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, @@ -428,11 +430,17 @@ g_slice_conf_hot(struct g_geom *gp, u_int idx, off_t offset, off_t length, int r { struct g_slicer *gsp; struct g_slice_hot *gsl, *gsl2; + struct g_provider *pp; g_trace(G_T_TOPOLOGY, "g_slice_conf_hot(%s, idx: %d, off: %jd, len: %jd)", gp->name, idx, (intmax_t)offset, (intmax_t)length); g_topology_assert(); gsp = gp->softc; + /* Deny unmapped I/O if hotspots are used. */ + if (gsp->nhotspot == 0) { + LIST_FOREACH(pp, &gp->provider, provider) + pp->flags &= ~G_PF_ACCEPT_UNMAPPED; + } gsl = gsp->hotspot; if(idx >= gsp->nhotspot) { gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_WAITOK | M_ZERO); |