public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/report report.c
@ 2012-01-25 13:11 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2012-01-25 13:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 13:11:53

Modified files:
	lib/report     : report.c 

Log message:
	Thin read  percent info from layered device
	
	Since we only need layered device - check for tpool device presence,
	so user doesn't need to activate thin pool explicitely for percent info.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150

--- LVM2/lib/report/report.c	2012/01/20 22:02:04	1.149
+++ LVM2/lib/report/report.c	2012/01/25 13:11:52	1.150
@@ -919,7 +919,7 @@
 	char *repstr;
 
 	/* Suppress data percent if not thin pool/volume or not using driver */
-	if (!lv_info(lv->vg->cmd, lv, 0, &info, 0, 0) || !info.exists) {
+	if (!lv_info(lv->vg->cmd, lv, 1, &info, 0, 0) || !info.exists) {
 		dm_report_field_set_value(field, "", NULL);
 		return 1;
 	}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* LVM2/lib/report report.c
@ 2010-02-15 20:27 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-02-15 20:27 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-02-15 20:27:33

Modified files:
	lib/report     : report.c 

Log message:
	Use dm_report_field_int32 instead of dm_report_field_uint64 for printing '-1'

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.114&r2=1.115

--- LVM2/lib/report/report.c	2010/02/15 18:35:06	1.114
+++ LVM2/lib/report/report.c	2010/02/15 20:27:33	1.115
@@ -50,7 +50,8 @@
 	}
 }
 
-static const uint64_t _minusone = UINT64_C(-1);
+static const uint64_t _minusone64 = UINT64_C(-1);
+static const int32_t _minusone32 = INT32_C(-1);
 
 /*
  * Data-munging functions to prepare each data type for display and sorting
@@ -247,7 +248,7 @@
 	if (lv_info(lv->vg->cmd, lv, &info, 0, 0) && info.exists)
 		return dm_report_field_int(rh, field, &info.major);
 
-	return dm_report_field_uint64(rh, field, &_minusone);
+	return dm_report_field_int32(rh, field, &_minusone32);
 }
 
 static int _lvkmin_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)),
@@ -260,7 +261,7 @@
 	if (lv_info(lv->vg->cmd, lv, &info, 0, 0) && info.exists)
 		return dm_report_field_int(rh, field, &info.minor);
 
-	return dm_report_field_uint64(rh, field, &_minusone);
+	return dm_report_field_int32(rh, field, &_minusone32);
 }
 
 static int _lv_mimage_in_sync(const struct logical_volume *lv)
@@ -643,7 +644,7 @@
 	const struct logical_volume *lv = (const struct logical_volume *) data;
 
 	if (lv->read_ahead == DM_READ_AHEAD_AUTO) {
-		dm_report_field_set_value(field, "auto", &_minusone);
+		dm_report_field_set_value(field, "auto", &_minusone64);
 		return 1;
 	}
 
@@ -659,7 +660,7 @@
 	struct lvinfo info;
 
 	if (!lv_info(lv->vg->cmd, lv, &info, 0, 1) || !info.exists)
-		return dm_report_field_uint64(rh, field, &_minusone);
+		return dm_report_field_int32(rh, field, &_minusone32);
 
 	return _size32_disp(rh, mem, field, &info.read_ahead, private);
 }


^ permalink raw reply	[flat|nested] 6+ messages in thread

* LVM2/lib/report report.c
@ 2010-02-15 18:35 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-02-15 18:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-02-15 18:35:06

Modified files:
	lib/report     : report.c 

Log message:
	Cleanup float arithmetic gcc warning.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.113&r2=1.114

--- LVM2/lib/report/report.c	2010/02/15 18:34:00	1.113
+++ LVM2/lib/report/report.c	2010/02/15 18:35:06	1.114
@@ -1049,7 +1049,7 @@
 		return 0;
 	}
 
-	*sortval = snap_percent * UINT64_C(1000);
+	*sortval = (uint64_t)(snap_percent * 1000.f);
 	dm_report_field_set_value(field, repstr, sortval);
 
 	return 1;
@@ -1091,7 +1091,7 @@
 		return 0;
 	}
 
-	*sortval = percent * UINT64_C(1000);
+	*sortval = (uint64_t)(percent * 1000.f);
 	dm_report_field_set_value(field, repstr, sortval);
 
 	return 1;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* LVM2/lib/report report.c
@ 2010-01-13  1:49 snitzer
  0 siblings, 0 replies; 6+ messages in thread
From: snitzer @ 2010-01-13  1:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-13 01:49:22

Modified files:
	lib/report     : report.c 

Log message:
	When there is merging snapshot, report percentage on the origin LV.
	Because the snapshot LV will be hidden this is needed so the user can
	see merging progress with "lvs" command.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109

--- LVM2/lib/report/report.c	2010/01/13 01:48:38	1.108
+++ LVM2/lib/report/report.c	2010/01/13 01:49:22	1.109
@@ -1023,7 +1023,7 @@
 		return 0;
 	}
 
-	if (!lv_is_cow(lv) ||
+	if ((!lv_is_cow(lv) && !lv->merging_snapshot) ||
 	    (lv_info(lv->vg->cmd, lv, &info, 0, 0) && !info.exists)) {
 		*sortval = UINT64_C(0);
 		dm_report_field_set_value(field, "", sortval);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* LVM2/lib/report report.c
@ 2007-07-10 18:20 agk
  0 siblings, 0 replies; 6+ messages in thread
From: agk @ 2007-07-10 18:20 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-07-10 18:20:00

Modified files:
	lib/report     : report.c 

Log message:
	tidy

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59

--- LVM2/lib/report/report.c	2007/07/10 18:18:33	1.58
+++ LVM2/lib/report/report.c	2007/07/10 18:20:00	1.59
@@ -723,7 +723,7 @@
 			const void *data, void *private)
 {
 	struct lvmcache_info *info; 
-	uint32_t count = 0;
+	uint32_t count;
 	const char *pvid = (const char *)(&((struct id *) data)->uuid);
 
 	info = info_from_pvid(pvid);
@@ -906,8 +906,8 @@
 #undef FIELD
 
 void *report_init(struct cmd_context *cmd, const char *format, const char *keys,
-                  report_type_t *report_type, const char *separator,
-                  int aligned, int buffered, int headings)
+		  report_type_t *report_type, const char *separator,
+		  int aligned, int buffered, int headings)
 {
 	uint32_t report_flags = 0;
 
@@ -920,7 +920,7 @@
 	if (headings)
 		report_flags |= DM_REPORT_OUTPUT_HEADINGS;
 
-        return dm_report_init(report_type, _report_types, _fields, format,
+	return dm_report_init(report_type, _report_types, _fields, format,
 			      separator, report_flags, keys, cmd);
 }
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* LVM2/lib/report report.c
@ 2007-07-10 18:18 agk
  0 siblings, 0 replies; 6+ messages in thread
From: agk @ 2007-07-10 18:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-07-10 18:18:33

Modified files:
	lib/report     : report.c 

Log message:
	Fix pv_mda_count to cope with missing PV.
	[vgcreate vg1 pv1 pv2; pvremove -ff pv1; pvs -P -o+pv_mda_count =>segfault]

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58

--- LVM2/lib/report/report.c	2007/07/09 15:40:43	1.57
+++ LVM2/lib/report/report.c	2007/07/10 18:18:33	1.58
@@ -723,10 +723,11 @@
 			const void *data, void *private)
 {
 	struct lvmcache_info *info; 
-	uint32_t count;
+	uint32_t count = 0;
+	const char *pvid = (const char *)(&((struct id *) data)->uuid);
 
-	info = info_from_pvid((const char *)(&((struct id *) data)->uuid));
-	count = list_size(&info->mdas);
+	info = info_from_pvid(pvid);
+	count = info ? list_size(&info->mdas) : 0;
 
 	return _uint32_disp(rh, mem, field, &count, private);
 }


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-25 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-25 13:11 LVM2/lib/report report.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2010-02-15 20:27 zkabelac
2010-02-15 18:35 zkabelac
2010-01-13  1:49 snitzer
2007-07-10 18:20 agk
2007-07-10 18:18 agk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).