* [PATCH 2/4] Add copy_uuid_helper
@ 2008-09-15 1:03 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2008-09-15 1:03 UTC (permalink / raw)
To: xfs; +Cc: Dave Chinner
[-- Attachment #1: xfs-add-copy_uuid-helper --]
[-- Type: text/plain, Size: 1549 bytes --]
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@sgi.com>
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);
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-15 1:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-15 1:03 [PATCH 2/4] Add copy_uuid_helper Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox