Skip to contentSkip to conversation

master - refactor: rename 'lv_type' field to 'lv_role'

PATCH Peter Rajnoha 1 participant 1 message Aug 25, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=993f8d1b3f6cd6f04d0b9bfe858c35161e262dc4
Commit:        993f8d1b3f6cd6f04d0b9bfe858c35161e262dc4
Parent:        66326e2fb8c84b57505f1396d394a96ec25e12c3
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Mon Aug 25 09:07:03 2014 +0200
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Mon Aug 25 16:11:40 2014 +0200

refactor: rename 'lv_type' field to 'lv_role'

The 'lv_type' field name was a bit misleading. Better one is 'lv_role' since this fields describes what's the actual use of the LV currently - its 'role'.

---
 WHATS_NEW                        |    2 +-
 lib/metadata/lv_manip.c          |  144 +++++++++++++++++++-------------------
 lib/metadata/metadata-exported.h |    4 +-
 lib/report/columns.h             |    2 +-
 lib/report/properties.c          |    4 +-
 lib/report/report.c              |   14 ++--
 6 files changed, 85 insertions(+), 85 deletions(-)
WHATS_NEW +1 -1
index af6ced4..c42d1d5 100644
@@ -5,7 +5,7 @@ Version 2.02.110 -
   Allow conversion of raid1 LV into a snapshot LV or snapshot origin LV.
   Cleanly error when creating RAID with stripe size < PAGE_SIZE.
   Print name of LV which on activation triggers delayed snapshot merge.
-  Add lv_layout and lv_type LV reporting fields.
+  Add lv_layout and lv_role LV reporting fields.
   Properly display lvs lv_attr volume type and target type bit for cache origin.
   Fix pvcreate_check() to update cache correctly after signature wiping.
   Fix primary device lookup failure for partition when processing mpath filter.
lib/metadata/lv_manip.c +72 -72

323 lines not on this page · raw message

lib/metadata/metadata-exported.h +2 -2
index ff24911..0db4334 100644
@@ -191,8 +191,8 @@
 #define lv_is_pool_metadata(lv)		(((lv)->status & (CACHE_POOL_METADATA | THIN_POOL_METADATA)) ? 1 : 0)
 #define lv_is_pool_metadata_spare(lv)	(((lv)->status & (POOL_METADATA_SPARE)) ? 1 : 0)
 
-int lv_layout_and_type(struct dm_pool *mem, const struct logical_volume *lv,
-		       struct dm_list **layout, struct dm_list **type);
+int lv_layout_and_role(struct dm_pool *mem, const struct logical_volume *lv,
+		       struct dm_list **layout, struct dm_list **role);
 
 /* Ordered list - see lv_manip.c */
 typedef enum {
lib/report/columns.h +1 -1
index d203f3d..78f5832 100644
@@ -40,7 +40,7 @@ FIELD(LVS, lv, STR, "DMPath", lvid, 6, lvdmpath, lv_dm_path, "Internal device-ma
 FIELD(LVS, lv, STR, "Parent", lvid, 6, lvparent, lv_parent, "For LVs that are components of another LV, the parent LV.", 0)
 FIELD(LVS, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
 FIELD(LVS, lv, STR_LIST, "Layout", lvid, 10, lvlayout, lv_layout, "LV layout.", 0)
-FIELD(LVS, lv, STR_LIST, "Type", lvid, 10, lvtype, lv_type, "LV type.", 0)
+FIELD(LVS, lv, STR_LIST, "Role", lvid, 10, lvrole, lv_role, "LV role.", 0)
 FIELD(LVS, lv, BIN, "InitImgSync", lvid, 10, lvinitialimagesync, lv_initial_image_sync, "Set if mirror/RAID images underwent initial resynchronization.", 0)
 FIELD(LVS, lv, BIN, "ImgSynced", lvid, 10, lvimagesynced, lv_image_synced, "Set if mirror/RAID image is synchronized.", 0)
 FIELD(LVS, lv, BIN, "Merging", lvid, 10, lvmerging, lv_merging, "Set if snapshot LV is being merged to origin.", 0)
lib/report/properties.c +2 -2
index eac8c2c..e0092db 100644
@@ -181,8 +181,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
 
 #define _lv_layout_set prop_not_implemented_set
 #define _lv_layout_get prop_not_implemented_get
-#define _lv_type_set prop_not_implemented_set
-#define _lv_type_get prop_not_implemented_get
+#define _lv_role_set prop_not_implemented_set
+#define _lv_role_get prop_not_implemented_get
 #define _lv_initial_image_sync_set prop_not_implemented_set
 #define _lv_initial_image_sync_get prop_not_implemented_get
 #define _lv_image_synced_get prop_not_implemented_get
lib/report/report.c +7 -7
index 69151e0..32aca88 100644
@@ -1324,9 +1324,9 @@ static int _lvlayout_disp(struct dm_report *rh, struct dm_pool *mem,
 {
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	struct dm_list *lv_layout;
-	struct dm_list *lv_type;
+	struct dm_list *lv_role;
 
-	if (!lv_layout_and_type(mem, lv, &lv_layout, &lv_type)) {
+	if (!lv_layout_and_role(mem, lv, &lv_layout, &lv_role)) {
 		log_error("Failed to display layout for LV %s/%s.", lv->vg->name, lv->name);
 		return 0;
 	}
@@ -1334,20 +1334,20 @@ static int _lvlayout_disp(struct dm_report *rh, struct dm_pool *mem,
 	return _field_set_string_list(rh, field, lv_layout, private);
 }
 
-static int _lvtype_disp(struct dm_report *rh, struct dm_pool *mem,
+static int _lvrole_disp(struct dm_report *rh, struct dm_pool *mem,
 			      struct dm_report_field *field,
 			      const void *data, void *private)
 {
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 	struct dm_list *lv_layout;
-	struct dm_list *lv_type;
+	struct dm_list *lv_role;
 
-	if (!lv_layout_and_type(mem, lv, &lv_layout, &lv_type)) {
-		log_error("Failed to display type for LV %s/%s.", lv->vg->name, lv->name);
+	if (!lv_layout_and_role(mem, lv, &lv_layout, &lv_role)) {
+		log_error("Failed to display role for LV %s/%s.", lv->vg->name, lv->name);
 		return 0;
 	}
 
-	return _field_set_string_list(rh, field, lv_type, private);
+	return _field_set_string_list(rh, field, lv_role, private);
 }
 
 static int _lvinitialimagesync_disp(struct dm_report *rh, struct dm_pool *mem,