aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_uuid.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-05-17 04:02:48 -0400
committerChristoph Hellwig <hch@lst.de>2017-06-05 10:58:59 -0400
commitf9727a17db9bab71ddae91f74f11a8a2f9a0ece6 (patch)
tree3d009fcaddd7ce14d1ddd2b6cefcaa33f5615b81 /lib/test_uuid.c
parent60927bc314363f91616c1f4577541c2a2e27aba3 (diff)
uuid: rename uuid types
Our "little endian" UUID really is a Wintel GUID, so rename it and its helpers such (guid_t). The big endian UUID is the only true one, so give it the name uuid_t. The uuid_le and uuid_be names are retained for now, but will hopefully go away soon. The exception to that are the _cmp helpers that will be replaced by better primitives ASAP and thus don't get the new names. Also the _to_bin helpers are named to match the better named uuid_parse routine in userspace. Also remove the existing typedef in XFS that's now been superceeded by the generic type name. Signed-off-by: Christoph Hellwig <hch@lst.de> [andy: also update the UUID_LE/UUID_BE macros including fallout] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'lib/test_uuid.c')
-rw-r--r--lib/test_uuid.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/test_uuid.c b/lib/test_uuid.c
index 547d3127a3cf..ff36f3240e90 100644
--- a/lib/test_uuid.c
+++ b/lib/test_uuid.c
@@ -11,25 +11,25 @@
11 11
12struct test_uuid_data { 12struct test_uuid_data {
13 const char *uuid; 13 const char *uuid;
14 uuid_le le; 14 guid_t le;
15 uuid_be be; 15 uuid_t be;
16}; 16};
17 17
18static const struct test_uuid_data test_uuid_test_data[] = { 18static const struct test_uuid_data test_uuid_test_data[] = {
19 { 19 {
20 .uuid = "c33f4995-3701-450e-9fbf-206a2e98e576", 20 .uuid = "c33f4995-3701-450e-9fbf-206a2e98e576",
21 .le = UUID_LE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), 21 .le = GUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
22 .be = UUID_BE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76), 22 .be = UUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
23 }, 23 },
24 { 24 {
25 .uuid = "64b4371c-77c1-48f9-8221-29f054fc023b", 25 .uuid = "64b4371c-77c1-48f9-8221-29f054fc023b",
26 .le = UUID_LE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), 26 .le = GUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
27 .be = UUID_BE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b), 27 .be = UUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
28 }, 28 },
29 { 29 {
30 .uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84", 30 .uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84",
31 .le = UUID_LE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), 31 .le = GUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
32 .be = UUID_BE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84), 32 .be = UUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
33 }, 33 },
34}; 34};
35 35
@@ -61,13 +61,13 @@ static void __init test_uuid_failed(const char *prefix, bool wrong, bool be,
61 61
62static void __init test_uuid_test(const struct test_uuid_data *data) 62static void __init test_uuid_test(const struct test_uuid_data *data)
63{ 63{
64 uuid_le le; 64 guid_t le;
65 uuid_be be; 65 uuid_t be;
66 char buf[48]; 66 char buf[48];
67 67
68 /* LE */ 68 /* LE */
69 total_tests++; 69 total_tests++;
70 if (uuid_le_to_bin(data->uuid, &le)) 70 if (guid_parse(data->uuid, &le))
71 test_uuid_failed("conversion", false, false, data->uuid, NULL); 71 test_uuid_failed("conversion", false, false, data->uuid, NULL);
72 72
73 total_tests++; 73 total_tests++;
@@ -78,7 +78,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
78 78
79 /* BE */ 79 /* BE */
80 total_tests++; 80 total_tests++;
81 if (uuid_be_to_bin(data->uuid, &be)) 81 if (uuid_parse(data->uuid, &be))
82 test_uuid_failed("conversion", false, true, data->uuid, NULL); 82 test_uuid_failed("conversion", false, true, data->uuid, NULL);
83 83
84 total_tests++; 84 total_tests++;
@@ -90,17 +90,17 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
90 90
91static void __init test_uuid_wrong(const char *data) 91static void __init test_uuid_wrong(const char *data)
92{ 92{
93 uuid_le le; 93 guid_t le;
94 uuid_be be; 94 uuid_t be;
95 95
96 /* LE */ 96 /* LE */
97 total_tests++; 97 total_tests++;
98 if (!uuid_le_to_bin(data, &le)) 98 if (!guid_parse(data, &le))
99 test_uuid_failed("negative", true, false, data, NULL); 99 test_uuid_failed("negative", true, false, data, NULL);
100 100
101 /* BE */ 101 /* BE */
102 total_tests++; 102 total_tests++;
103 if (!uuid_be_to_bin(data, &be)) 103 if (!uuid_parse(data, &be))
104 test_uuid_failed("negative", true, true, data, NULL); 104 test_uuid_failed("negative", true, true, data, NULL);
105} 105}
106 106