Skip to contentSkip to conversation

DM Snapshot: shot new ctr table format

PATCH New Jonathan Brassow 1 participant 1 message Apr 6, 2009 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DM Snapshot: shot new ctr table format

Patch name: dm-snapshot-new-ctr-table-format.patch

From: Jonathan Brassow <[email protected]>

Introduce the new constructor table formats for snapshots and exception stores. This allows for new exception store types and allows for easy addition of future features to snapshots.

---
 drivers/md/dm-snap-persistent.c |    9 ++++++--
 drivers/md/dm-snap-transient.c  |    9 ++++++--
 drivers/md/dm-snap.c            |   41 +++++++++++++++++++++++++++++++++-------
 3 files changed, 48 insertions(+), 11 deletions(-)
drivers/md/dm-snap-persistent.c +7 -2
Index: linux-2.6/drivers/md/dm-snap-persistent.c
===================================================================
@@ -708,8 +708,13 @@ static unsigned persistent_status(struct
 	case STATUSTYPE_INFO:
 		break;
 	case STATUSTYPE_TABLE:
-		DMEMIT(" %s P %llu", store->cow->name,
-		       (unsigned long long)store->chunk_size);
+		if (!strcmp("P", store->type->name))
+			DMEMIT(" %s P %llu", store->cow->name,
+			       (unsigned long long)store->chunk_size);
+		else
+			DMEMIT(" %s 2 %s %llu", store->type->name,
+			       store->cow->name,
+			       (unsigned long long)store->chunk_size);
 	}
 
 	return sz;
drivers/md/dm-snap-transient.c +7 -2
Index: linux-2.6/drivers/md/dm-snap-transient.c
===================================================================
@@ -91,8 +91,13 @@ static unsigned transient_status(struct 
 	case STATUSTYPE_INFO:
 		break;
 	case STATUSTYPE_TABLE:
-		DMEMIT(" %s N %llu", store->cow->name,
-		       (unsigned long long)store->chunk_size);
+		if (!strcmp("N", store->type->name))
+			DMEMIT(" %s N %llu", store->cow->name,
+			       (unsigned long long)store->chunk_size);
+		else
+			DMEMIT(" %s 2 %s %llu", store->type->name,
+			       store->cow->name,
+			       (unsigned long long)store->chunk_size);
 	}
 
 	return sz;
drivers/md/dm-snap.c +34 -7

80 lines not on this page · raw message