From: Jonathan Brassow Date: Tue, 19 Jan 2010 20:22:37 -0600 Subject: [PATCH 8 of 10] LVM: add logic to allow mirrored log Message-ID: <201001200222.o0K2Mbmk024333@hydrogen.msp.redhat.com> List-Id: To: lvm-devel@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch name: lvm-add-logic-to-allow-mirrored-log.patch Insert the couple of lines that adds the logic necessary to create the mirrored/redundant log. RFC: Jonathan Brassow Index: LVM2/lib/metadata/mirror.c =================================================================== --- LVM2.orig/lib/metadata/mirror.c +++ LVM2/lib/metadata/mirror.c @@ -1592,7 +1592,7 @@ static struct logical_volume *_set_up_mi struct alloc_handle *ah, struct logical_volume *lv, uint32_t log_count, - uint32_t region_size __attribute((unused)), + uint32_t region_size, alloc_policy_t alloc, int in_sync) { @@ -1636,6 +1636,12 @@ static struct logical_volume *_set_up_mi return NULL; } + if ((log_count > 1) && + !_form_mirror(cmd, ah, log_lv, log_count-1, region_size, 1)) { + log_error("Failed to form mirrored log."); + return NULL; + } + if (!_init_mirror_log(cmd, log_lv, in_sync, &lv->tags, 1)) { log_error("Failed to initialise mirror log."); return NULL;