diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c index f9be59101592..df30c379ed92 100644 --- a/sys/geom/concat/g_concat.c +++ b/sys/geom/concat/g_concat.c @@ -210,20 +210,16 @@ g_concat_candelete(struct bio *bp) { struct g_concat_softc *sc; struct g_concat_disk *disk; - int i, *val; - - val = (int *)bp->bio_data; - *val = 0; + int i, val; sc = bp->bio_to->geom->softc; for (i = 0; i < sc->sc_ndisks; i++) { disk = &sc->sc_disks[i]; - if (!disk->d_removed && disk->d_candelete) { - *val = 1; + if (!disk->d_removed && disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < sc->sc_ndisks; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 125f81b98e6a..5ccb8362e19a 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -1086,16 +1086,15 @@ g_mirror_candelete(struct bio *bp) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - int *val; + int val; sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; } - val = (int *)bp->bio_data; - *val = (disk != NULL); - g_io_deliver(bp, 0); + val = disk != NULL; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c index 77b6bbf3ef17..bc8cd153456a 100644 --- a/sys/geom/raid/g_raid.c +++ b/sys/geom/raid/g_raid.c @@ -1075,23 +1075,19 @@ g_raid_candelete(struct g_raid_softc *sc, struct bio *bp) struct g_provider *pp; struct g_raid_volume *vol; struct g_raid_subdisk *sd; - int *val; - int i; + int i, val; - val = (int *)bp->bio_data; pp = bp->bio_to; vol = pp->private; - *val = 0; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; if (sd->sd_state == G_RAID_SUBDISK_S_NONE) continue; - if (sd->sd_disk->d_candelete) { - *val = 1; + if (sd->sd_disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < vol->v_disks_count; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void