From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Cc: Dave Chinner <dgc@sgi.com>
Subject: [PATCH 2/4] Add copy_uuid_helper
Date: Mon, 15 Sep 2008 03:03:17 +0200 [thread overview]
Message-ID: <20080915010317.GC13062@lst.de> (raw)
[-- 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);
--
reply other threads:[~2008-09-15 1:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080915010317.GC13062@lst.de \
--to=hch@lst.de \
--cc=dgc@sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox