public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/lib/display display.c
Date: Mon, 05 Nov 2007 02:10:00 -0000	[thread overview]
Message-ID: <20071105021040.21291.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-11-05 02:10:39

Modified files:
	lib/display    : display.c 

Log message:
	adjust sizes for metadata

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81

--- LVM2/lib/display/display.c	2007/11/05 01:47:48	1.80
+++ LVM2/lib/display/display.c	2007/11/05 02:10:39	1.81
@@ -295,7 +295,7 @@
 	const char *size;
 
 	uint32_t pe_free;
-	uint64_t used_size, pvsize, unusable;
+	uint64_t data_size, pvsize, unusable;
 
 	if (!pv)
 		return;
@@ -310,17 +310,17 @@
 	log_print("VG Name               %s%s", pv->vg_name,
 		  pv->status & EXPORTED_VG ? " (exported)" : "");
 
-	used_size = (uint64_t) pv->pe_count * pv->pe_size;
-	if (pv->size > used_size) {
+	data_size = (uint64_t) pv->pe_count * pv->pe_size;
+	if (pv->size > data_size + pv->pe_start) {
 		pvsize = pv->size;
-		unusable = pvsize - used_size;
+		unusable = pvsize - data_size;
 	} else {
-		pvsize = used_size;
-		unusable = used_size - pv->size;
+		pvsize = data_size + pv->pe_start;
+		unusable = pvsize - pv->size;
 	}
 
 	size = display_size(cmd, pvsize);
-	if (used_size)
+	if (data_size)
 		log_print("PV Size               %s / not usable %s",	/*  [LVM: %s]", */
 			  size, display_size(cmd, unusable));
 	else


             reply	other threads:[~2007-11-05  2:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05  2:10 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-01-25 17:14 agk
2011-10-04 12:40 zkabelac
2011-10-03 18:31 zkabelac
2011-09-27 12:34 agk
2011-09-26 13:11 zkabelac
2010-06-28 20:32 wysochanski
2009-07-27 10:18 wysochanski
2008-08-07 14:01 zkabelac
2008-04-10 19:16 agk
2007-11-05 17:13 agk
2007-05-31 20:26 wysochanski
2007-05-31 15:18 wysochanski
2004-03-30 14:35 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071105021040.21291.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).