FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 02-26-2010, 10:36 PM
Jonathan Brassow
 
Default LVM: add mirrored log type

Patch name: lvm-add-mirrored-log-type.patch

Now it is trivial to add the 'mirrored' mirror log.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

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}]]
"
+ "[-m|--mirrors Mirrors [{--mirrorlog {disk|core|mirrored}|--corelog}]]
"
" [--repair [--use-policies]]
"
" [-R|--regionsize MirrorLogRegionSize]
"
" [--alloc AllocationPolicy]
"
@@ -154,7 +154,7 @@ xx(lvcreate,
" {-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] |
"
" -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
"
" [-M|--persistent {y|n}] [--major major] [--minor minor]
"
- " [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core}|--corelog}]]
"
+ " [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]]
"
" [-n|--name LogicalVolumeName]
"
" [--noudevsync]
"
" [-p|--permission {r|rw}]
"
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;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org