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 ./WHATS_NEW lib/metadata/lv_manip.c
Date: Fri, 11 May 2012 18:59:00 -0000	[thread overview]
Message-ID: <20120511185903.521.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-05-11 18:59:02

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.
	Remove some unnecesary prev_lvseg checks.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2401&r2=1.2402
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.377&r2=1.378

--- LVM2/WHATS_NEW	2012/05/10 08:54:33	1.2401
+++ LVM2/WHATS_NEW	2012/05/11 18:59:01	1.2402
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.
   Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92).
   Fix division by zero if PV with zero PE count is used during vgcfgrestore.
   Add initial support for thin pool lvconvert.
--- LVM2/lib/metadata/lv_manip.c	2012/05/11 15:32:19	1.377
+++ LVM2/lib/metadata/lv_manip.c	2012/05/11 18:59:01	1.378
@@ -39,10 +39,12 @@
 #define RAID_METADATA_AREA_LEN 1
 
 /* FIXME These ended up getting used differently from first intended.  Refactor. */
-#define A_CONTIGUOUS		0x01
-#define A_CLING			0x02
-#define A_CLING_BY_TAGS		0x04
-#define A_CLING_TO_ALLOCED	0x08	/* Only for ALLOC_NORMAL */
+/* Only one of A_CONTIGUOUS_TO_LVSEG, A_CLING_TO_LVSEG, A_CLING_TO_ALLOCED may be set */
+#define A_CONTIGUOUS_TO_LVSEG	0x01	/* Must be contiguous to an existing segment */
+#define A_CLING_TO_LVSEG	0x02	/* Must use same disks as existing LV segment */
+#define A_CLING_TO_ALLOCED	0x04	/* Must use same disks as already-allocated segment */
+
+#define A_CLING_BY_TAGS		0x08	/* Must match tags against existing segment */
 #define A_CAN_SPLIT		0x10
 
 /*
@@ -907,11 +909,11 @@
 	/* Are there any preceding segments we must follow on from? */
 	if (alloc_parms->prev_lvseg) {
 		if (alloc_parms->alloc == ALLOC_CONTIGUOUS)
-			alloc_parms->flags |= A_CONTIGUOUS;
+			alloc_parms->flags |= A_CONTIGUOUS_TO_LVSEG;
 		else if (alloc_parms->alloc == ALLOC_CLING)
-			alloc_parms->flags |= A_CLING;
+			alloc_parms->flags |= A_CLING_TO_LVSEG;
 		else if (alloc_parms->alloc == ALLOC_CLING_BY_TAGS) {
-			alloc_parms->flags |= A_CLING;
+			alloc_parms->flags |= A_CLING_TO_LVSEG;
 			alloc_parms->flags |= A_CLING_BY_TAGS;
 		}
 	}
@@ -1494,14 +1496,14 @@
 				return NEXT_AREA;
 
 	/* If maximise_cling is set, perform several checks, otherwise perform exactly one. */
-	if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS | A_CLING | A_CLING_TO_ALLOCED)) {
+	if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG | A_CLING_TO_ALLOCED)) {
 		/* Contiguous? */
-		if (((alloc_parms->flags & A_CONTIGUOUS) || ah->maximise_cling) &&
-		    alloc_parms->prev_lvseg && _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state))
+		if (((alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG) || (ah->maximise_cling && alloc_parms->prev_lvseg)) &&
+		    _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state))
 			return PREFERRED;
 	
 		/* Try next area on same PV if looking for contiguous space */
-		if (alloc_parms->flags & A_CONTIGUOUS)
+		if (alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG)
 			return NEXT_AREA;
 	
 		/* Cling_to_alloced? */
@@ -1667,7 +1669,7 @@
 	uint32_t devices_needed = ah->area_count + ah->parity_count;
 
 	/* ix_offset holds the number of parallel allocations that must be contiguous/cling */
-	if (alloc_parms->flags & (A_CONTIGUOUS | A_CLING) && alloc_parms->prev_lvseg)
+	if (alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG))
 		ix_offset = _stripes_per_mimage(alloc_parms->prev_lvseg) * alloc_parms->prev_lvseg->area_count;
 
 	if (alloc_parms->flags & A_CLING_TO_ALLOCED)


             reply	other threads:[~2012-05-11 18:59 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 18:59 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-11 22:19 agk
2012-05-09 12:12 zkabelac
2012-03-05 14:13 zkabelac
2012-02-29 22:09 zkabelac
2012-02-22 17:14 jbrassow
2012-02-09 15:13 prajnoha
2012-02-08 13:02 zkabelac
2012-01-20 22:04 snitzer
2011-11-15 17:32 zkabelac
2011-11-15 17:28 zkabelac
2011-10-28 20:23 zkabelac
2011-10-28 20:17 zkabelac
2011-09-14 14:20 mbroz
2011-09-13 18:43 jbrassow
2011-06-29 17:05 agk
2011-04-07 21:49 jbrassow
2011-02-27  1:16 agk
2011-01-28  2:58 snitzer
2010-12-20 14:38 zkabelac
2010-12-01 12:56 zkabelac
2010-03-29 17:59 agk
2010-03-25 18:16 agk
2010-03-23 15:07 agk
2010-01-12 20:53 agk
2010-01-05 15:58 mbroz
2009-05-30  0:09 agk
2009-05-28  1:59 agk
2009-05-28  0:29 agk
2008-12-19 15:26 mbroz
2008-10-23 11:21 agk
2008-10-17 10:57 agk
2008-09-29  9:59 mbroz
2008-02-22 13:22 agk
2007-01-05 15:53 mbroz
2006-12-12 19:30 agk
2006-10-30 16:10 agk
2006-10-07 23:40 agk
2006-10-07 12:41 agk
2006-10-07 11:00 agk
2006-10-05 21:24 agk
2005-11-28 20:01 agk
2005-11-24 18:46 agk
2005-07-12 14:50 agk
2005-06-03 18:07 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=20120511185903.521.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).