Skip to contentSkip to conversation

master - segments: mark more of them unzeroable

PATCH Zdenek Kabelac 1 participant 1 message Oct 24, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=298de1f5c3c2a84eb4c12f4697c110016a98237e
Commit:        298de1f5c3c2a84eb4c12f4697c110016a98237e
Parent:        784c216d2beb21bf793d33d1ebf600ab30454bb7
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 20 14:57:24 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Oct 24 16:39:32 2014 +0200

segments: mark more of them unzeroable

Use segment flags to avoid zeroing of cache, cache pool snapshot and thin pool segments.

We never want to zero these segment types.

Note:
Snapshot COW and Cache origin are created as stripes thus are then properly zeroed.

---
 WHATS_NEW                 |    1 +
 lib/cache_segtype/cache.c |    2 +-
 lib/snapshot/snapshot.c   |    2 +-
 lib/thin/thin.c           |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
index b1f8410..1bdb884 100644
@@ -1,5 +1,6 @@
 Version 2.02.112 - 
 =====================================
+  Mark pools and snapshots as unzeroable volumes.
   Check for zeroing of volume after segment type is fully detected.
   Better support for persistent major and minor options with lvcreate.
   Refactor lvcreate towards more complete validation of all supported options.
lib/cache_segtype/cache.c +1 -1
index 9927688..8c2ff78 100644
@@ -391,7 +391,7 @@ int init_cache_segtypes(struct cmd_context *cmd,
 	segtype->cmd = cmd;
 
 	segtype->name = "cache-pool";
-	segtype->flags = SEG_CACHE_POOL;
+	segtype->flags = SEG_CACHE_POOL | SEG_CANNOT_BE_ZEROED;
 	segtype->ops = &_cache_pool_ops;
 	segtype->private = NULL;
 
lib/snapshot/snapshot.c +1 -1
index 18e8111..aefab3a 100644
@@ -262,7 +262,7 @@ struct segment_type *init_segtype(struct cmd_context *cmd)
 	segtype->ops = &_snapshot_ops;
 	segtype->name = "snapshot";
 	segtype->private = NULL;
-	segtype->flags = SEG_SNAPSHOT;
+	segtype->flags = SEG_SNAPSHOT | SEG_CANNOT_BE_ZEROED;
 
 #ifdef DEVMAPPER_SUPPORT
 #  ifdef DMEVENTD
lib/thin/thin.c +1 -1
index 9ae237e..bb13b2b 100644
@@ -753,7 +753,7 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl
 		const char name[16];
 		uint32_t flags;
 	} reg_segtypes[] = {
-		{ &_thin_pool_ops, "thin-pool", SEG_THIN_POOL },
+		{ &_thin_pool_ops, "thin-pool", SEG_THIN_POOL | SEG_CANNOT_BE_ZEROED },
 		/* FIXME Maybe use SEG_THIN_VOLUME instead of SEG_VIRTUAL */
 		{ &_thin_ops, "thin", SEG_THIN_VOLUME | SEG_VIRTUAL }
 	};