Skip to contentSkip to conversation

master - thin: add common pool functions

PATCH Zdenek Kabelac 1 participant 1 message Nov 19, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f4137640f60af5377615a1b9e50238b593cf272b
Commit:        f4137640f60af5377615a1b9e50238b593cf272b
Parent:        2e96ea4a899a0d0a5adb5e3d8fa09e04fd7a4173
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Nov 15 14:48:32 2012 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Nov 19 14:38:17 2012 +0100

thin: add common pool functions

Move common functions for lvcreate and lvconvert.

get_pool_params() - read thin pool args. update_pool_params() - updates/validates some thin args.

It is getting complicated and even few more things will be implemented, so to avoid reimplementing things differently in lvcreate and lvconvert code has been splitted into 2 common functions that allow some future extension.

---
 WHATS_NEW       |    1 +
 tools/toollib.c |  129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/toollib.h |    9 ++++
 3 files changed, 139 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index 8117165..59a69da 100644
@@ -1,5 +1,6 @@
 Version 2.02.99 - 
 ===================================
+  Move common functionality for thin lvcreate and lvconvert to toollib.
   Mirrored log is now fixed before its mirror when double-fault occurs.
   Add python-lvm unit test case
   Exit pvscan --cache immediately if cluster locking used or lvmetad not used.
tools/toollib.c +129 -0

141 lines not on this page · raw message

tools/toollib.h +9 -0
index b3b0a7c..09071b3 100644
@@ -111,6 +111,15 @@ int pvcreate_params_validate(struct cmd_context *cmd,
 
 int get_activation_monitoring_mode(struct cmd_context *cmd,
 				   int *monitoring_mode);
+int get_pool_params(struct cmd_context *cmd,
+		    uint32_t *chunk_size,
+		    thin_discards_t *discards,
+		    uint64_t *pool_metadata_size,
+		    int *zero);
+int update_pool_params(struct cmd_context *cmd, unsigned attr,
+		       uint32_t data_extents, uint32_t extent_size,
+		       uint32_t *chunk_size, thin_discards_t *discards,
+		       uint64_t *pool_metadata_size);
 int get_stripe_params(struct cmd_context *cmd, uint32_t *stripes,
 		      uint32_t *stripe_size);