Skip to contentSkip to conversation

master - lvcreate: refactor code

PATCH Zdenek Kabelac 1 participant 1 message Oct 6, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=487723e0dfbaf23236e7ea1415497a8bb394440d
Commit:        487723e0dfbaf23236e7ea1415497a8bb394440d
Parent:        072e25a965afdd76145248edea18c3b9e36967df
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Sep 28 22:31:30 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 6 14:52:16 2014 +0200

lvcreate: refactor code

Over the time lvcreate code has accumulated various hacks. So try to move that code in right places.

Detect all types early in _lvcreate_params() so functions like _read_size_params() do not need to change volume types.

Also ultimately respect give volume --type, that its shortcut (-T, H, -m, -s) and after that options which do type estimation. (i.e. --cachepool, --thinpool)

Avoid repeative tests - if we know all types are decode at once place we can 'optimize' number of validations.

---
 WHATS_NEW        |    1 +
 tools/lvcreate.c |  163 ++++++++++++++++++++++++++++--------------------------
 2 files changed, 86 insertions(+), 78 deletions(-)
WHATS_NEW +1 -0
index ad7bafb..1ac7750 100644
@@ -1,5 +1,6 @@
 Version 2.02.112 - 
 =====================================
+  Refactor lvcreate code and better preserve --type argument.
   Refactor process_each_vg in toollib.
   Pools cannot be used as external origin.
   Use lv_update_and_reload() for snapshot reload.
tools/lvcreate.c +85 -78

226 lines not on this page · raw message