diff options
author | Christoph Hellwig <hch@sgi.com> | 2006-01-10 23:37:17 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-01-10 23:37:17 -0500 |
commit | 794fe2dc65f1ec4acacc388053bb52d32d3a932e (patch) | |
tree | 3aecc571134961cdf78fa392b14d02ae84f7f1c4 /fs/xfs | |
parent | 60a204f096dd67683f3993798e14905ee9828ba5 (diff) |
[XFS] endianess annotations and tidying for the uuid code
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:203709a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/support/uuid.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/xfs/support/uuid.c b/fs/xfs/support/uuid.c index 69ec4f540c3..a3d565a6773 100644 --- a/fs/xfs/support/uuid.c +++ b/fs/xfs/support/uuid.c | |||
@@ -27,6 +27,16 @@ uuid_init(void) | |||
27 | mutex_init(&uuid_monitor); | 27 | mutex_init(&uuid_monitor); |
28 | } | 28 | } |
29 | 29 | ||
30 | |||
31 | /* IRIX interpretation of an uuid_t */ | ||
32 | typedef struct { | ||
33 | __be32 uu_timelow; | ||
34 | __be16 uu_timemid; | ||
35 | __be16 uu_timehi; | ||
36 | __be16 uu_clockseq; | ||
37 | __be16 uu_node[3]; | ||
38 | } xfs_uu_t; | ||
39 | |||
30 | /* | 40 | /* |
31 | * uuid_getnodeuniq - obtain the node unique fields of a UUID. | 41 | * uuid_getnodeuniq - obtain the node unique fields of a UUID. |
32 | * | 42 | * |
@@ -36,16 +46,11 @@ uuid_init(void) | |||
36 | void | 46 | void |
37 | uuid_getnodeuniq(uuid_t *uuid, int fsid [2]) | 47 | uuid_getnodeuniq(uuid_t *uuid, int fsid [2]) |
38 | { | 48 | { |
39 | char *uu = (char *)uuid; | 49 | xfs_uu_t *uup = (xfs_uu_t *)uuid; |
40 | |||
41 | /* on IRIX, this function assumes big-endian fields within | ||
42 | * the uuid, so we use INT_GET to get the same result on | ||
43 | * little-endian systems | ||
44 | */ | ||
45 | 50 | ||
46 | fsid[0] = (INT_GET(*(u_int16_t*)(uu+8), ARCH_CONVERT) << 16) + | 51 | fsid[0] = (be16_to_cpu(uup->uu_clockseq) << 16) | |
47 | INT_GET(*(u_int16_t*)(uu+4), ARCH_CONVERT); | 52 | be16_to_cpu(uup->uu_timemid); |
48 | fsid[1] = INT_GET(*(u_int32_t*)(uu ), ARCH_CONVERT); | 53 | fsid[1] = be16_to_cpu(uup->uu_timelow); |
49 | } | 54 | } |
50 | 55 | ||
51 | void | 56 | void |