Skip to contentSkip to conversation

master - cache: add tool support

PATCH Zdenek Kabelac 1 participant 1 message Jul 11, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f9d80c9d31d7113ab8bc08baf6bba96a7449261f
Commit:        f9d80c9d31d7113ab8bc08baf6bba96a7449261f
Parent:        5c3d8940136f39a017ab434651789647161350b1
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Jul 4 16:31:29 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Jul 11 12:47:35 2014 +0200

cache: add tool support

Introducing cache tool support.

---
 WHATS_NEW                    |    1 +
 conf/example.conf.in         |   30 ++++++++++++++
 configure.in                 |   89 +++++++++++++++++++++++++++++++++++++++---
 lib/config/config_settings.h |    5 ++
 lib/config/defaults.h        |    2 +
 lib/misc/configure.h.in      |   12 ++++++
 6 files changed, 133 insertions(+), 6 deletions(-)
WHATS_NEW +1 -0
index 29a0aa3..77cc2d7 100644
@@ -1,5 +1,6 @@
 Version 2.02.108 -
 =================================
+  Add initial code to use cache tools (cache_check|dump|repair|restore).
   Add "degraded" activation mode and make it the default.
   Add separate lv_active_{locally,remotely,exclusively} LV reporting fields.
   Recognize "auto"/"unmanaged" values in selection for appropriate fields only.
conf/example.conf.in +30 -0
index 91768fb..2930054 100644
@@ -744,6 +744,36 @@ global {
     #   external_origin_extend
     #
     # thin_disabled_features = [ "discards", "block_size" ]
+
+    # Full path of the utility called to check that a cache metadata device
+    # is in a state that allows it to be used.
+    # Each time a cached LV needs to be used or after it is deactivated
+    # this utility is executed. The activation will only proceed if the utility
+    # has an exit status of 0.
+    # Set to "" to skip this check.  (Not recommended.)
+    # The cache tools are available as part of the device-mapper-persistent-data
+    # package from https://github.com/jthornber/thin-provisioning-tools.
+    #
+    # cache_check_executable = "@CACHE_CHECK_CMD@"
+
+    # Array of string options passed with cache_check command. By default,
+    # option "-q" is for quiet output.
+    #
+    # cache_check_options = [ "-q" ]
+
+    # Full path of the utility called to repair a cache metadata device.
+    # Each time a cache metadata needs repair this utility is executed.
+    # See cache_check_executable how to obtain binaries.
+    #
+    # cache_repair_executable = "@CACHE_REPAIR_CMD@"
+
+    # Array of extra string options passed with cache_repair command.
+    # cache_repair_options = [ "" ]
+
+    # Full path of the utility called to dump cache metadata content.
+    # See cache_check_executable how to obtain binaries.
+    #
+    # cache_dump_executable = "@CACHE_DUMP_CMD@"
 }
 
 activation {
configure.in +83 -6

129 lines not on this page · raw message

lib/config/config_settings.h +5 -0
index 455eb4f..c6be2e3 100644
@@ -182,6 +182,11 @@ cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CF
 cfg(global_thin_dump_executable_CFG, "thin_dump_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_DUMP_CMD, vsn(2, 2, 100), NULL)
 cfg(global_thin_repair_executable_CFG, "thin_repair_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_REPAIR_CMD, vsn(2, 2, 100), NULL)
 cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_THIN_REPAIR_OPTIONS, vsn(2, 2, 100), NULL)
+cfg(global_cache_check_executable_CFG, "cache_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, CACHE_CHECK_CMD, vsn(2, 2, 108), NULL)
+cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_CACHE_CHECK_OPTIONS, vsn(2, 2, 108), NULL)
+cfg(global_cache_dump_executable_CFG, "cache_dump_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, CACHE_DUMP_CMD, vsn(2, 2, 108), NULL)
+cfg(global_cache_repair_executable_CFG, "cache_repair_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, CACHE_REPAIR_CMD, vsn(2, 2, 108), NULL)
+cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_CACHE_REPAIR_OPTIONS, vsn(2, 2, 108), NULL)
 
 cfg(activation_checks_CFG, "checks", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION_CHECKS, vsn(2, 2, 86), NULL)
 cfg(activation_udev_sync_CFG, "udev_sync", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_UDEV_SYNC, vsn(2, 2, 51), NULL)
lib/config/defaults.h +2 -0
index 815d6a3..05187b0 100644
@@ -90,6 +90,8 @@
 #define DEFAULT_THIN_POOL_ZERO 1
 #define DEFAULT_POOL_METADATA_SPARE 1 /* thin + cache */
 
+#define DEFAULT_CACHE_CHECK_OPTIONS "-q"
+#define DEFAULT_CACHE_REPAIR_OPTIONS ""
 #define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
 #define DEFAULT_CACHE_POOL_CHUNK_SIZE 64 /* KB */
 #define DEFAULT_CACHE_POOL_MIN_METADATA_SIZE 2048  /* KB */
lib/misc/configure.h.in +12 -0
index c618ff4..f137f14 100644
@@ -3,9 +3,21 @@
 /* Define to 1 to use libblkid detection of signatures when wiping. */
 #undef BLKID_WIPING_SUPPORT
 
+/* The path to 'cache_check', if available. */
+#undef CACHE_CHECK_CMD
+
+/* The path to 'cache_dump', if available. */
+#undef CACHE_DUMP_CMD
+
 /* Define to 1 to include built-in support for cache. */
 #undef CACHE_INTERNAL
 
+/* The path to 'cache_repair', if available. */
+#undef CACHE_REPAIR_CMD
+
+/* The path to 'cache_restore', if available. */
+#undef CACHE_RESTORE_CMD
+
 /* Define to 1 if the `closedir' function returns void instead of `int'. */
 #undef CLOSEDIR_VOID