diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 09:10:34 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 09:10:34 -0800 |
commit | 9f5974c8734d83d4ab7096ed98136a82f41210d6 (patch) | |
tree | 6f328555796bafefb74936ab68128aa84efd28b1 /fs/xfs/support/uuid.c | |
parent | a2d823bf13efea4c859376f6e85c49cfbad7ab60 (diff) | |
parent | ddae9c2ea79449beb00027cf77fca6dc489f2d15 (diff) | |
download | op-kernel-dev-9f5974c8734d83d4ab7096ed98136a82f41210d6.zip op-kernel-dev-9f5974c8734d83d4ab7096ed98136a82f41210d6.tar.gz |
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
Diffstat (limited to 'fs/xfs/support/uuid.c')
-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 69ec4f5..a3d565a 100644 --- a/fs/xfs/support/uuid.c +++ b/fs/xfs/support/uuid.c @@ -27,6 +27,16 @@ uuid_init(void) mutex_init(&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. * @@ -36,16 +46,11 @@ uuid_init(void) 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] = be16_to_cpu(uup->uu_timelow); } void |