From patchwork Fri Feb 26 23:36:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 82507 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1QNiBf5016033 for ; Fri, 26 Feb 2010 23:44:47 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNgG85002477; Fri, 26 Feb 2010 18:42:16 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNakSx021737 for ; Fri, 26 Feb 2010 18:36:46 -0500 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNaeZL025983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 26 Feb 2010 18:36:41 -0500 Received: from hydrogen.msp.redhat.com (localhost.localdomain [127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id o1QNaeAN024424 for ; Fri, 26 Feb 2010 17:36:40 -0600 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id o1QNaeoU024423 for dm-devel@redhat.com; Fri, 26 Feb 2010 17:36:40 -0600 Date: Fri, 26 Feb 2010 17:36:40 -0600 From: Jonathan Brassow Message-Id: <201002262336.o1QNaeoU024423@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 6 of 10] LVM: add mirrored log type X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 26 Feb 2010 23:44:47 +0000 (UTC) Index: LVM2/tools/commands.h =================================================================== --- LVM2.orig/tools/commands.h +++ LVM2/tools/commands.h @@ -96,7 +96,7 @@ xx(lvconvert, "Change logical volume layout", 0, "lvconvert " - "[-m|--mirrors Mirrors [{--mirrorlog {disk|core}|--corelog}]]\n" + "[-m|--mirrors Mirrors [{--mirrorlog {disk|core|mirrored}|--corelog}]]\n" "\t[--repair [--use-policies]]\n" "\t[-R|--regionsize MirrorLogRegionSize]\n" "\t[--alloc AllocationPolicy]\n" @@ -154,7 +154,7 @@ xx(lvcreate, "\t{-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] |\n" "\t -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}\n" "\t[-M|--persistent {y|n}] [--major major] [--minor minor]\n" - "\t[-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core}|--corelog}]]\n" + "\t[-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]]\n" "\t[-n|--name LogicalVolumeName]\n" "\t[--noudevsync]\n" "\t[-p|--permission {r|rw}]\n" Index: LVM2/tools/lvconvert.c =================================================================== --- LVM2.orig/tools/lvconvert.c +++ LVM2/tools/lvconvert.c @@ -874,7 +874,9 @@ static int _lvconvert_mirrors(struct cmd return 0; } - if (!strcmp("disk", mirrorlog)) + if (!strcmp("mirrored", mirrorlog)) + log_count = 2; + else if (!strcmp("disk", mirrorlog)) log_count = 1; else if (!strcmp("core", mirrorlog)) log_count = 0; Index: LVM2/tools/lvcreate.c =================================================================== --- LVM2.orig/tools/lvcreate.c +++ LVM2/tools/lvcreate.c @@ -337,12 +337,14 @@ static int _read_mirror_params(struct lv mirrorlog = arg_str_value(cmd, mirrorlog_ARG, corelog ? "core" : DEFAULT_MIRRORLOG); - if (!strcmp("disk", mirrorlog)) { - if (corelog) { - log_error("--mirrorlog disk and --corelog " - "are incompatible"); - return 0; - } + if (strcmp("core", mirrorlog) && corelog) { + log_error("Please use only one of --mirrorlog or --corelog"); + return 0; + } + + if (!strcmp("mirrored", mirrorlog)) { + lp->log_count = 2; + } else if (!strcmp("disk", mirrorlog)) { lp->log_count = 1; } else if (!strcmp("core", mirrorlog)) lp->log_count = 0;