This is the mail archive of the lvm2-cvs@sourceware.org mailing list for the LVM2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

LVM2 ./WHATS_NEW lib/format_text/format-text.c ...


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]