diff options
author | mav <mav@FreeBSD.org> | 2012-10-29 18:04:38 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-10-29 18:04:38 +0000 |
commit | a43d540d9efdfd22157e434662f6be55d1437f32 (patch) | |
tree | 3057436f0446cd34f89a0161970b65aabfad7947 /sys/geom/raid/md_promise.c | |
parent | 76f8fadfa80a4732a2670b0032c3ac3fc89da8c7 (diff) | |
download | FreeBSD-src-a43d540d9efdfd22157e434662f6be55d1437f32.zip FreeBSD-src-a43d540d9efdfd22157e434662f6be55d1437f32.tar.gz |
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
Diffstat (limited to 'sys/geom/raid/md_promise.c')
-rw-r--r-- | sys/geom/raid/md_promise.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/sys/geom/raid/md_promise.c b/sys/geom/raid/md_promise.c index cd50a40..5512b5a 100644 --- a/sys/geom/raid/md_promise.c +++ b/sys/geom/raid/md_promise.c @@ -1046,7 +1046,7 @@ g_raid_md_taste_promise(struct g_raid_md_object *md, struct g_class *mp, struct promise_raid_conf *meta, *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; - int error, i, j, result, len, subdisks; + int i, j, result, len, subdisks; char name[16]; uint16_t vendor; @@ -1142,14 +1142,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_promise_new_disk(disk); @@ -1337,15 +1330,7 @@ g_raid_md_ctl_promise(struct g_raid_md_object *md, break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); @@ -1659,15 +1644,7 @@ g_raid_md_ctl_promise(struct g_raid_md_object *md, disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); |