public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/format_text/format-text.c ...
Date: Thu, 17 Aug 2006 19:31:00 -0000	[thread overview]
Message-ID: <20060817193059.23709.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-08-17 19:30:59

Modified files:
	.              : WHATS_NEW 
	lib/format_text: format-text.c 
	lib/metadata   : metadata.c metadata.h 

Log message:
	wrap PE_ALIGN

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.421&r2=1.422
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.147&r2=1.148

--- LVM2/WHATS_NEW	2006/08/17 19:15:27	1.421
+++ LVM2/WHATS_NEW	2006/08/17 19:30:59	1.422
@@ -1,6 +1,6 @@
 Version 2.02.09 - 
 ==================================
-  Separate out LVM1_PE_ALIGN.
+  Separate out LVM1_PE_ALIGN and pe_align().
   Add lvm_getpagesize wrapper.
   Add --maxphysicalvolumes to vgchange.
 
--- LVM2/lib/format_text/format-text.c	2006/08/17 18:23:43	1.63
+++ LVM2/lib/format_text/format-text.c	2006/08/17 19:30:59	1.64
@@ -994,7 +994,7 @@
 }
 
 /* For orphan, creates new mdas according to policy.
-   Always have an mda between end-of-label and PE_ALIGN boundary */
+   Always have an mda between end-of-label and pe_align() boundary */
 static int _mda_setup(const struct format_type *fmt,
 		      uint64_t pe_start, uint64_t pe_end,
 		      int pvmetadatacopies,
@@ -1009,11 +1009,11 @@
 
 	if (!pvmetadatacopies) {
 		/* Space available for PEs */
-		pv->size -= PE_ALIGN;
+		pv->size -= pe_align();
 		return 1;
 	}
 
-	alignment = PE_ALIGN << SECTOR_SHIFT;
+	alignment = pe_align() << SECTOR_SHIFT;
 	disk_size = pv->size << SECTOR_SHIFT;
 	pe_start <<= SECTOR_SHIFT;
 	pe_end <<= SECTOR_SHIFT;
@@ -1055,7 +1055,7 @@
 		pvmetadatacopies = 1;
 	}
 
-	/* Round up to PE_ALIGN boundary */
+	/* Round up to pe_align() boundary */
 	mda_adjustment = (mda_size1 + start1) % alignment;
 	if (mda_adjustment)
 		mda_size1 += (alignment - mda_adjustment);
@@ -1189,7 +1189,7 @@
 
 	/* Set pe_start to first aligned sector after any metadata 
 	 * areas that begin before pe_start */
-	pv->pe_start = PE_ALIGN;
+	pv->pe_start = pe_align();
 	list_iterate_items(mda, &info->mdas) {
 		mdac = (struct mda_context *) mda->metadata_locn;
 		if (pv->dev == mdac->area.dev &&
@@ -1198,9 +1198,9 @@
 		     (pv->pe_start << SECTOR_SHIFT))) {
 			pv->pe_start = (mdac->area.start + mdac->area.size)
 			    >> SECTOR_SHIFT;
-			adjustment = pv->pe_start % PE_ALIGN;
+			adjustment = pv->pe_start % pe_align();
 			if (adjustment)
-				pv->pe_start += (PE_ALIGN - adjustment);
+				pv->pe_start += (pe_align() - adjustment);
 		}
 	}
 	if (!add_da
--- LVM2/lib/metadata/metadata.c	2006/08/09 19:33:25	1.95
+++ LVM2/lib/metadata/metadata.c	2006/08/17 19:30:59	1.96
@@ -24,6 +24,11 @@
 #include "pv_alloc.h"
 #include "activate.h"
 
+unsigned long pe_align(void)
+{
+	return (65536UL >> SECTOR_SHIFT);
+}
+
 static int _add_pv_to_vg(struct format_instance *fid, struct volume_group *vg,
 			 const char *pv_name)
 {
@@ -78,8 +83,8 @@
 
 	/* FIXME Do proper rounding-up alignment? */
 	/* Reserved space for label; this holds 0 for PVs created by LVM1 */
-	if (pv->pe_start < PE_ALIGN)
-		pv->pe_start = PE_ALIGN;
+	if (pv->pe_start < pe_align())
+		pv->pe_start = pe_align();
 
 	/*
 	 * The next two fields should be corrected
--- LVM2/lib/metadata/metadata.h	2006/08/17 18:23:43	1.147
+++ LVM2/lib/metadata/metadata.h	2006/08/17 19:30:59	1.148
@@ -33,7 +33,6 @@
 #define STRIPE_SIZE_MAX ( 512L * 1024L >> SECTOR_SHIFT)	/* 512 KB in sectors */
 #define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1)
 #define PV_MIN_SIZE ( 512L * 1024L >> SECTOR_SHIFT)	/* 512 KB in sectors */
-#define PE_ALIGN (65536UL >> SECTOR_SHIFT)	/* PE alignment */
 #define MAX_RESTRICTED_LVS 255	/* Used by FMT_RESTRICTED_LVIDS */
 
 /* Various flags */
@@ -403,6 +402,7 @@
 /*
  * Utility functions
  */
+unsigned long pe_align(void);
 int vg_validate(struct volume_group *vg);
 int vg_write(struct volume_group *vg);
 int vg_commit(struct volume_group *vg);


             reply	other threads:[~2006-08-17 19:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-17 19:31 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-09 12:31 prajnoha
2011-04-21 13:13 zkabelac
2011-02-28 13:19 prajnoha
2011-02-25 14:08 prajnoha
2009-05-07 12:11 mbroz
2007-11-05 17:17 agk
2007-04-25 21:10 wysochanski
2007-03-23 12:43 mbroz
2007-01-09 21:12 agk
2006-10-05 22:02 agk
2006-08-17 19:53 agk
2006-04-29 22:08 agk
2005-09-01 18:37 agk
2005-04-06 18:59 agk
2005-01-20 18:11 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=20060817193059.23709.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --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).