diff options
author | phk <phk@FreeBSD.org> | 2003-04-22 21:19:17 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-22 21:19:17 +0000 |
commit | 13d95d603f604c5d49f0dca34c7a2ec015bb6a46 (patch) | |
tree | f0a7f1f402fb7d0e9601f88844fc176f940805a6 /sys/geom/geom_slice.c | |
parent | 00bb631612e9d3526f8c2ac1383ea97a86a4dbb8 (diff) | |
download | FreeBSD-src-13d95d603f604c5d49f0dca34c7a2ec015bb6a46.zip FreeBSD-src-13d95d603f604c5d49f0dca34c7a2ec015bb6a46.tar.gz |
Do not mandate that slicers have a private ->start(), they may not need
one. KASSERT() that they have one if G_SLICE_HOT_START is used.
Diffstat (limited to 'sys/geom/geom_slice.c')
-rw-r--r-- | sys/geom/geom_slice.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 5bca219..2474143 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -230,7 +230,7 @@ g_slice_start(struct bio *bp) return; case BIO_GETATTR: /* Give the real method a chance to override */ - if (gsp->start(bp)) + if (gsp->start != NULL && gsp->start(bp)) return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { struct g_kerneldump *gkd; @@ -394,6 +394,9 @@ g_slice_conf_hot(struct g_geom *gp, u_int idx, off_t offset, off_t length, int r } gsl[idx].offset = offset; gsl[idx].length = length; + KASSERT(!((ract | dact | wact) & G_SLICE_HOT_START) + || gsp->start != NULL, ("G_SLICE_HOT_START but no slice->start")); + /* XXX: check that we _have_ a start function if HOT_START specified */ gsl[idx].ract = ract; gsl[idx].dact = dact; gsl[idx].wact = wact; |