]> sourceware.org Git - lvm2.git/commitdiff
Add device/md_chunk_alignment to lvm.conf
authorAlasdair Kergon <agk@redhat.com>
Fri, 19 Sep 2008 05:33:37 +0000 (05:33 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 19 Sep 2008 05:33:37 +0000 (05:33 +0000)
WHATS_NEW
doc/example.conf
lib/config/defaults.h
lib/metadata/metadata.c

index b0fcbca316927618ce1c36bbec437612fe829957..2a27861b24389338d3869e8a31b2144bc2d28dd6 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.40 - 
 ================================
+  Add device/md_chunk_alignment to lvm.conf.
   Pass struct physical_volume to pe_align and adjust for md chunk size.
   Store sysfs location in struct cmd_context.
   Avoid shuffling remaining mirror images when removing one, retaining primary.
index 8eceafe3f29686f178e0436b38f559008e485060..ca85d32a5fc560b08c5a65c5213122ada85e58c6 100644 (file)
@@ -93,6 +93,11 @@ devices {
     # 1 enables; 0 disables.
     md_component_detection = 1
 
+    # By default, if a PV is placed directly upon an md device, LVM2
+    # will align its data blocks with the the chunk_size exposed in sysfs.
+    # 1 enables; 0 disables.
+    md_chunk_alignment = 1
+
     # If, while scanning the system for PVs, LVM2 encounters a device-mapper
     # device that has its I/O suspended, it waits for it to become accessible.
     # Set this to 1 to skip such devices.  This should only be needed
index 645cfddfb54231f84f7415910c77a259ce913553..9566c6ea23facf495a3d4cb4ecb2a3bf41b6a408 100644 (file)
@@ -32,6 +32,7 @@
 #define DEFAULT_PROC_DIR "/proc"
 #define DEFAULT_SYSFS_SCAN 1
 #define DEFAULT_MD_COMPONENT_DETECTION 1
+#define DEFAULT_MD_CHUNK_ALIGNMENT 1
 #define DEFAULT_IGNORE_SUSPENDED_DEVICES 1
 
 #define DEFAULT_LOCK_DIR "/var/lock/lvm"
index 3dd2036326a0008ad1413bb118d32081b0ab22f0..ecf4152a32693d7dc88903fab5887ef0c2303811 100644 (file)
@@ -27,6 +27,7 @@
 #include "display.h"
 #include "locking.h"
 #include "archiver.h"
+#include "defaults.h"
 
 #include <sys/param.h>
 
@@ -74,7 +75,9 @@ unsigned long pe_align(struct physical_volume *pv)
        /*
         * Align to chunk size of underlying md device if present
         */
-       if (pv->dev)
+       if (pv->dev &&
+           find_config_tree_bool(pv->fmt->cmd, "devices/md_chunk_alignment",
+                                 DEFAULT_MD_CHUNK_ALIGNMENT))
                pv->pe_align = MAX(pv->pe_align,
                                   dev_md_chunk_size(pv->fmt->cmd->sysfs_dir,
                                                     pv->dev));
This page took 0.04855 seconds and 5 git commands to generate.