Skip to contentSkip to conversation

Add copy_uuid_helper

PATCH New Christoph Hellwig 1 participant 1 message Sep 15, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Add copy_uuid_helper

Add a helper to copy an uuid from one place to another. This will ne needed for various CRC-enabled data structures that grow uuids to check that the block really belongs to this filesystem.

[hch: split out from another patch]

fs/xfs/support/uuid.c +6 -0
Index: linux-2.6-xfs/fs/xfs/support/uuid.c
===================================================================
@@ -72,6 +72,12 @@ uuid_equal(uuid_t *uuid1, uuid_t *uuid2)
 	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1;
 }
 
+void
+uuid_copy(uuid_t *dst, uuid_t *src)
+{
+	memcpy(dst, src, sizeof(uuid_t));
+}
+
 /*
  * Given a 128-bit uuid, return a 64-bit value by adding the top and bottom
  * 64-bit words.  NOTE: This function can not be changed EVER.  Although
fs/xfs/support/uuid.h +1 -0
Index: linux-2.6-xfs/fs/xfs/support/uuid.h
===================================================================
@@ -25,6 +25,7 @@ typedef struct {
 extern void uuid_create_nil(uuid_t *uuid);
 extern int uuid_is_nil(uuid_t *uuid);
 extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
+extern void uuid_copy(uuid_t *dst, uuid_t *src);
 extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]);
 extern __uint64_t uuid_hash64(uuid_t *uuid);
 extern int uuid_table_insert(uuid_t *uuid);