Index: head/sys/geom/concat/g_concat.c
===================================================================
--- head/sys/geom/concat/g_concat.c
+++ head/sys/geom/concat/g_concat.c
@@ -279,8 +279,11 @@
g_destroy_bio(bp);
}
+/*
+ * Called for both BIO_FLUSH and BIO_SPEEDUP. Just pass the call down
+ */
static void
-g_concat_flush(struct g_concat_softc *sc, struct bio *bp)
+g_concat_passdown(struct g_concat_softc *sc, struct bio *bp)
{
struct bio_queue_head queue;
struct g_consumer *cp;
@@ -340,8 +343,9 @@
case BIO_WRITE:
case BIO_DELETE:
break;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
- g_concat_flush(sc, bp);
+ g_concat_passdown(sc, bp);
return;
case BIO_GETATTR:
if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) {
Index: head/sys/geom/eli/g_eli.c
===================================================================
--- head/sys/geom/eli/g_eli.c
+++ head/sys/geom/eli/g_eli.c
@@ -429,6 +429,7 @@
case BIO_GETATTR:
case BIO_FLUSH:
case BIO_ZONE:
+ case BIO_SPEEDUP:
break;
case BIO_DELETE:
/*
@@ -468,6 +469,7 @@
case BIO_GETATTR:
case BIO_FLUSH:
case BIO_DELETE:
+ case BIO_SPEEDUP:
case BIO_ZONE:
if (bp->bio_cmd == BIO_GETATTR)
cbp->bio_done = g_eli_getattr_done;
Index: head/sys/geom/gate/g_gate.c
===================================================================
--- head/sys/geom/gate/g_gate.c
+++ head/sys/geom/gate/g_gate.c
@@ -285,6 +285,7 @@
case BIO_DELETE:
case BIO_WRITE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
/* XXX: Hack to allow read-only mounts. */
if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) {
g_io_deliver(pbp, EPERM);
@@ -871,6 +872,7 @@
case BIO_READ:
case BIO_DELETE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
break;
case BIO_WRITE:
error = copyout(bp->bio_data, ggio->gctl_data,
@@ -935,6 +937,7 @@
case BIO_DELETE:
case BIO_WRITE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
break;
}
}
Index: head/sys/geom/geom_disk.c
===================================================================
--- head/sys/geom/geom_disk.c
+++ head/sys/geom/geom_disk.c
@@ -560,6 +560,17 @@
devstat_start_transaction_bio(dp->d_devstat, bp2);
dp->d_strategy(bp2);
break;
+ case BIO_SPEEDUP:
+ bp2 = g_clone_bio(bp);
+ if (bp2 == NULL) {
+ g_io_deliver(bp, ENOMEM);
+ return;
+ }
+ bp2->bio_done = g_disk_done;
+ bp2->bio_caller1 = sc;
+ bp2->bio_disk = dp;
+ dp->d_strategy(bp2);
+ break;
default:
error = EOPNOTSUPP;
break;
Index: head/sys/geom/geom_io.c
===================================================================
--- head/sys/geom/geom_io.c
+++ head/sys/geom/geom_io.c
@@ -407,6 +407,7 @@
break;
case BIO_WRITE:
case BIO_DELETE:
+ case BIO_SPEEDUP:
case BIO_FLUSH:
if (cp->acw == 0)
return (EPERM);
Index: head/sys/geom/geom_slice.c
===================================================================
--- head/sys/geom/geom_slice.c
+++ head/sys/geom/geom_slice.c
@@ -312,6 +312,7 @@
/* now, pass it on downwards... */
}
/* FALLTHROUGH */
+ case BIO_SPEEDUP:
case BIO_FLUSH:
bp2 = g_clone_bio(bp);
if (bp2 == NULL) {
Index: head/sys/geom/journal/g_journal.c
===================================================================
--- head/sys/geom/journal/g_journal.c
+++ head/sys/geom/journal/g_journal.c
@@ -746,6 +746,7 @@
return;
}
/* FALLTHROUGH */
+ case BIO_SPEEDUP:
case BIO_DELETE:
default:
g_io_deliver(bp, EOPNOTSUPP);
Index: head/sys/geom/linux_lvm/g_linux_lvm.c
===================================================================
--- head/sys/geom/linux_lvm/g_linux_lvm.c
+++ head/sys/geom/linux_lvm/g_linux_lvm.c
@@ -215,6 +215,10 @@
/* XXX BIO_GETATTR allowed? */
break;
default:
+ /*
+ * BIO_SPEEDUP and BIO_FLUSH should pass through to all sg
+ * elements, but aren't.
+ */
g_io_deliver(bp, EOPNOTSUPP);
return;
}
Index: head/sys/geom/mirror/g_mirror.c
===================================================================
--- head/sys/geom/mirror/g_mirror.c
+++ head/sys/geom/mirror/g_mirror.c
@@ -925,7 +925,8 @@
struct g_mirror_disk *disk, struct bio *bp)
{
- if (bp->bio_cmd == BIO_FLUSH && bp->bio_error == EOPNOTSUPP)
+ if ((bp->bio_cmd == BIO_FLUSH || bp->bio_cmd == BIO_SPEEDUP) &&
+ bp->bio_error == EOPNOTSUPP)
return;
if ((disk->d_flags & G_MIRROR_DISK_FLAG_BROKEN) == 0) {
@@ -988,6 +989,10 @@
KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_regular_request_flush,
bp->bio_error);
break;
+ case BIO_SPEEDUP:
+ KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_regular_request_speedup,
+ bp->bio_error);
+ break;
}
pbp->bio_inbed++;
@@ -1018,6 +1023,7 @@
case BIO_DELETE:
case BIO_WRITE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
pbp->bio_inbed--;
pbp->bio_children--;
break;
@@ -1043,6 +1049,7 @@
case BIO_DELETE:
case BIO_WRITE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
if (pbp->bio_children == 0) {
/*
* All requests failed.
@@ -1149,6 +1156,7 @@
case BIO_READ:
case BIO_WRITE:
case BIO_DELETE:
+ case BIO_SPEEDUP:
case BIO_FLUSH:
break;
case BIO_GETATTR:
@@ -1783,6 +1791,7 @@
*/
TAILQ_INSERT_TAIL(&sc->sc_inflight, bp, bio_queue);
return;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
TAILQ_INIT(&queue);
LIST_FOREACH(disk, &sc->sc_disks, d_next) {
Index: head/sys/geom/nop/g_nop.h
===================================================================
--- head/sys/geom/nop/g_nop.h
+++ head/sys/geom/nop/g_nop.h
@@ -71,6 +71,7 @@
uintmax_t sc_cmd0s;
uintmax_t sc_cmd1s;
uintmax_t sc_cmd2s;
+ uintmax_t sc_speedups;
uintmax_t sc_readbytes;
uintmax_t sc_wrotebytes;
char *sc_physpath;
Index: head/sys/geom/nop/g_nop.c
===================================================================
--- head/sys/geom/nop/g_nop.c
+++ head/sys/geom/nop/g_nop.c
@@ -255,6 +255,9 @@
case BIO_FLUSH:
sc->sc_flushes++;
break;
+ case BIO_SPEEDUP:
+ sc->sc_speedups++;
+ break;
case BIO_CMD0:
sc->sc_cmd0s++;
break;
@@ -438,6 +441,7 @@
sc->sc_deletes = 0;
sc->sc_getattrs = 0;
sc->sc_flushes = 0;
+ sc->sc_speedups = 0;
sc->sc_cmd0s = 0;
sc->sc_cmd1s = 0;
sc->sc_cmd2s = 0;
@@ -908,6 +912,7 @@
sc->sc_deletes = 0;
sc->sc_getattrs = 0;
sc->sc_flushes = 0;
+ sc->sc_speedups = 0;
sc->sc_cmd0s = 0;
sc->sc_cmd1s = 0;
sc->sc_cmd2s = 0;
@@ -978,6 +983,7 @@
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_deletes);
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_getattrs);
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_flushes);
+ sbuf_printf(sb, "%s%ju\n", indent, sc->sc_speedups);
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd0s);
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd1s);
sbuf_printf(sb, "%s%ju\n", indent, sc->sc_cmd2s);
Index: head/sys/geom/part/g_part.c
===================================================================
--- head/sys/geom/part/g_part.c
+++ head/sys/geom/part/g_part.c
@@ -2272,6 +2272,7 @@
bp2->bio_offset += entry->gpe_offset;
g_io_request(bp2, cp);
return;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
break;
case BIO_GETATTR:
Index: head/sys/geom/raid/g_raid.c
===================================================================
--- head/sys/geom/raid/g_raid.c
+++ head/sys/geom/raid/g_raid.c
@@ -1111,6 +1111,7 @@
case BIO_WRITE:
case BIO_DELETE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
break;
case BIO_GETATTR:
if (!strcmp(bp->bio_attribute, "GEOM::candelete"))
Index: head/sys/geom/raid/tr_concat.c
===================================================================
--- head/sys/geom/raid/tr_concat.c
+++ head/sys/geom/raid/tr_concat.c
@@ -224,7 +224,7 @@
g_raid_iodone(bp, EIO);
return;
}
- if (bp->bio_cmd == BIO_FLUSH) {
+ if (bp->bio_cmd == BIO_FLUSH || bp->bio_cmd == BIO_SPEEDUP) {
g_raid_tr_flush_common(tr, bp);
return;
}
Index: head/sys/geom/raid/tr_raid0.c
===================================================================
--- head/sys/geom/raid/tr_raid0.c
+++ head/sys/geom/raid/tr_raid0.c
@@ -204,7 +204,7 @@
g_raid_iodone(bp, EIO);
return;
}
- if (bp->bio_cmd == BIO_FLUSH) {
+ if (bp->bio_cmd == BIO_FLUSH || bp->bio_cmd == BIO_SPEEDUP) {
g_raid_tr_flush_common(tr, bp);
return;
}
Index: head/sys/geom/raid/tr_raid1.c
===================================================================
--- head/sys/geom/raid/tr_raid1.c
+++ head/sys/geom/raid/tr_raid1.c
@@ -641,6 +641,7 @@
case BIO_DELETE:
g_raid_tr_iostart_raid1_write(tr, bp);
break;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
g_raid_tr_flush_common(tr, bp);
break;
Index: head/sys/geom/raid/tr_raid1e.c
===================================================================
--- head/sys/geom/raid/tr_raid1e.c
+++ head/sys/geom/raid/tr_raid1e.c
@@ -869,6 +869,7 @@
case BIO_DELETE:
g_raid_tr_iostart_raid1e_write(tr, bp);
break;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
g_raid_tr_flush_common(tr, bp);
break;
Index: head/sys/geom/raid/tr_raid5.c
===================================================================
--- head/sys/geom/raid/tr_raid5.c
+++ head/sys/geom/raid/tr_raid5.c
@@ -357,6 +357,7 @@
case BIO_WRITE:
case BIO_DELETE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
g_raid_iodone(bp, ENODEV);
break;
default:
Index: head/sys/geom/raid3/g_raid3.c
===================================================================
--- head/sys/geom/raid3/g_raid3.c
+++ head/sys/geom/raid3/g_raid3.c
@@ -1446,6 +1446,7 @@
case BIO_WRITE:
case BIO_DELETE:
break;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
g_raid3_flush(sc, bp);
return;
Index: head/sys/geom/shsec/g_shsec.c
===================================================================
--- head/sys/geom/shsec/g_shsec.c
+++ head/sys/geom/shsec/g_shsec.c
@@ -316,6 +316,7 @@
case BIO_READ:
case BIO_WRITE:
case BIO_FLUSH:
+ case BIO_SPEEDUP:
/*
* Only those requests are supported.
*/
Index: head/sys/geom/stripe/g_stripe.c
===================================================================
--- head/sys/geom/stripe/g_stripe.c
+++ head/sys/geom/stripe/g_stripe.c
@@ -535,7 +535,7 @@
}
static void
-g_stripe_flush(struct g_stripe_softc *sc, struct bio *bp)
+g_stripe_pushdown(struct g_stripe_softc *sc, struct bio *bp)
{
struct bio_queue_head queue;
struct g_consumer *cp;
@@ -594,8 +594,9 @@
case BIO_WRITE:
case BIO_DELETE:
break;
+ case BIO_SPEEDUP:
case BIO_FLUSH:
- g_stripe_flush(sc, bp);
+ g_stripe_pushdown(sc, bp);
return;
case BIO_GETATTR:
/* To which provider it should be delivered? */