projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[powerpc.git]
/
fs
/
xfs
/
support
/
uuid.c
diff --git
a/fs/xfs/support/uuid.c
b/fs/xfs/support/uuid.c
index
70ce409
..
e157015
100644
(file)
--- a/
fs/xfs/support/uuid.c
+++ b/
fs/xfs/support/uuid.c
@@
-21,11
+21,14
@@
static mutex_t uuid_monitor;
static int uuid_table_size;
static uuid_t *uuid_table;
static int uuid_table_size;
static uuid_t *uuid_table;
-void
-uuid_init(void)
-{
- mutex_init(&uuid_monitor, MUTEX_DEFAULT, "uuid_monitor");
-}
+/* IRIX interpretation of an uuid_t */
+typedef struct {
+ __be32 uu_timelow;
+ __be16 uu_timemid;
+ __be16 uu_timehi;
+ __be16 uu_clockseq;
+ __be16 uu_node[3];
+} xfs_uu_t;
/*
* uuid_getnodeuniq - obtain the node unique fields of a UUID.
/*
* uuid_getnodeuniq - obtain the node unique fields of a UUID.
@@
-36,16
+39,11
@@
uuid_init(void)
void
uuid_getnodeuniq(uuid_t *uuid, int fsid [2])
{
void
uuid_getnodeuniq(uuid_t *uuid, int fsid [2])
{
- char *uu = (char *)uuid;
-
- /* on IRIX, this function assumes big-endian fields within
- * the uuid, so we use INT_GET to get the same result on
- * little-endian systems
- */
+ xfs_uu_t *uup = (xfs_uu_t *)uuid;
- fsid[0] = (
INT_GET(*(u_int16_t*)(uu+8), ARCH_CONVERT) << 16) +
-
INT_GET(*(u_int16_t*)(uu+4), ARCH_CONVERT
);
- fsid[1] =
INT_GET(*(u_int32_t*)(uu ), ARCH_CONVERT
);
+ fsid[0] = (
be16_to_cpu(uup->uu_clockseq) << 16) |
+
be16_to_cpu(uup->uu_timemid
);
+ fsid[1] =
be32_to_cpu(uup->uu_timelow
);
}
void
}
void
@@
-94,7
+92,7
@@
uuid_table_insert(uuid_t *uuid)
{
int i, hole;
{
int i, hole;
- mutex_lock(&uuid_monitor
, PVFS
);
+ mutex_lock(&uuid_monitor);
for (i = 0, hole = -1; i < uuid_table_size; i++) {
if (uuid_is_nil(&uuid_table[i])) {
hole = i;
for (i = 0, hole = -1; i < uuid_table_size; i++) {
if (uuid_is_nil(&uuid_table[i])) {
hole = i;
@@
-122,7
+120,7
@@
uuid_table_remove(uuid_t *uuid)
{
int i;
{
int i;
- mutex_lock(&uuid_monitor
, PVFS
);
+ mutex_lock(&uuid_monitor);
for (i = 0; i < uuid_table_size; i++) {
if (uuid_is_nil(&uuid_table[i]))
continue;
for (i = 0; i < uuid_table_size; i++) {
if (uuid_is_nil(&uuid_table[i]))
continue;
@@
-134,3
+132,9
@@
uuid_table_remove(uuid_t *uuid)
ASSERT(i < uuid_table_size);
mutex_unlock(&uuid_monitor);
}
ASSERT(i < uuid_table_size);
mutex_unlock(&uuid_monitor);
}
+
+void
+uuid_init(void)
+{
+ mutex_init(&uuid_monitor);
+}