From a43d540d9efdfd22157e434662f6be55d1437f32 Mon Sep 17 00:00:00 2001 From: mav Date: Mon, 29 Oct 2012 18:04:38 +0000 Subject: Add basic BIO_DELETE support to GEOM RAID class for all RAID levels. If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Sponsored by: iXsystems, Inc. MFC after: 1 month --- sys/geom/raid/tr_raid1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/geom/raid/tr_raid1.c') diff --git a/sys/geom/raid/tr_raid1.c b/sys/geom/raid/tr_raid1.c index d8bc236..ff5e5cd 100644 --- a/sys/geom/raid/tr_raid1.c +++ b/sys/geom/raid/tr_raid1.c @@ -647,10 +647,8 @@ g_raid_tr_iostart_raid1(struct g_raid_tr_object *tr, struct bio *bp) g_raid_tr_iostart_raid1_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -893,7 +891,7 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_cmd == BIO_WRITE) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; if (bp->bio_error != 0) { -- cgit v1.1