xfs
[Top] [All Lists]

[PATCH 2/4] Add copy_uuid_helper

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/4] Add copy_uuid_helper
From: Christoph Hellwig <hch@xxxxxx>
Date: Mon, 15 Sep 2008 03:03:17 +0200
Cc: Dave Chinner <dgc@xxxxxxx>
User-agent: Mutt/1.3.28i
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]


Signed-off-by: Dave Chinner <dgc@xxxxxxx>

Index: linux-2.6-xfs/fs/xfs/support/uuid.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/support/uuid.c    2008-09-01 20:49:20.000000000 
+0200
+++ linux-2.6-xfs/fs/xfs/support/uuid.c 2008-09-10 18:45:02.000000000 +0200
@@ -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
Index: linux-2.6-xfs/fs/xfs/support/uuid.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/support/uuid.h    2008-09-01 20:49:20.000000000 
+0200
+++ linux-2.6-xfs/fs/xfs/support/uuid.h 2008-09-10 18:45:02.000000000 +0200
@@ -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);

-- 

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 2/4] Add copy_uuid_helper, Christoph Hellwig <=