Skip to contentSkip to conversation

master - flags: add read and print of segtype flag

PATCH Zdenek Kabelac 1 participant 1 message May 29, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0299a7af1ec1eeb11388ed15c4c78f224fee76b2
Commit:        0299a7af1ec1eeb11388ed15c4c78f224fee76b2
Parent:        1bb0c5197f00594e50fb2b8a92f96633f32a9817
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon May 29 14:20:05 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon May 29 14:49:41 2017 +0200

flags: add read and print of segtype flag

Allow storing LV status bits with segment type name field. Switching to this since this field has better support for compatibility with older version of lvm2 - since such unknown segtype will not cause complete invisiblity of metadata from older lvm2 code - just the particular LV will become unusable with unknown type of segment.

---
 WHATS_NEW                       |    1 +
 lib/format_text/flags.c         |   58 +++++++++++++++++++++++++++++++++++++++
 lib/format_text/import-export.h |    3 ++
 3 files changed, 62 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index f38c23c..de65e0e 100644
@@ -1,5 +1,6 @@
 Version 2.02.172 - 
 ===============================
+  Support storing status flags via segtype name field.
   Stop using '--yes' mode when fsadm runs without terminal.
   Extend validation of filesystems resized by fsadm.
   Enhance lvconvert automatic settings of possible (raid) LV types.
lib/format_text/flags.c +58 -0

61 lines not on this page · raw message

lib/format_text/import-export.h +3 -0
index ddad50f..abb9b0e 100644
@@ -62,6 +62,9 @@ struct text_vg_version_ops *text_vg_vsn1_init(void);
 int print_flags(char *buffer, size_t size, enum pv_vg_lv_e type, int mask, uint64_t status);
 int read_flags(uint64_t *status, enum pv_vg_lv_e type, int mask, const struct dm_config_value *cv);
 
+int print_segtype_lvflags(char *buffer, size_t size, uint64_t status);
+int read_segtype_lvflags(uint64_t *status, char *segtype_scr);
+
 int text_vg_export_file(struct volume_group *vg, const char *desc, FILE *fp);
 size_t text_vg_export_raw(struct volume_group *vg, const char *desc, char **buf);
 struct volume_group *text_vg_import_file(struct format_instance *fid,