mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
60927bc314
commit
f9727a17db
6 changed files with 73 additions and 62 deletions
|
@ -11,25 +11,25 @@
|
|||
|
||||
struct test_uuid_data {
|
||||
const char *uuid;
|
||||
uuid_le le;
|
||||
uuid_be be;
|
||||
guid_t le;
|
||||
uuid_t be;
|
||||
};
|
||||
|
||||
static const struct test_uuid_data test_uuid_test_data[] = {
|
||||
{
|
||||
.uuid = "c33f4995-3701-450e-9fbf-206a2e98e576",
|
||||
.le = UUID_LE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
|
||||
.be = UUID_BE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
|
||||
.le = GUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
|
||||
.be = UUID_INIT(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
|
||||
},
|
||||
{
|
||||
.uuid = "64b4371c-77c1-48f9-8221-29f054fc023b",
|
||||
.le = UUID_LE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
|
||||
.be = UUID_BE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
|
||||
.le = GUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
|
||||
.be = UUID_INIT(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
|
||||
},
|
||||
{
|
||||
.uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84",
|
||||
.le = UUID_LE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
|
||||
.be = UUID_BE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
|
||||
.le = GUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
|
||||
.be = UUID_INIT(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -61,13 +61,13 @@ static void __init test_uuid_failed(const char *prefix, bool wrong, bool be,
|
|||
|
||||
static void __init test_uuid_test(const struct test_uuid_data *data)
|
||||
{
|
||||
uuid_le le;
|
||||
uuid_be be;
|
||||
guid_t le;
|
||||
uuid_t be;
|
||||
char buf[48];
|
||||
|
||||
/* LE */
|
||||
total_tests++;
|
||||
if (uuid_le_to_bin(data->uuid, &le))
|
||||
if (guid_parse(data->uuid, &le))
|
||||
test_uuid_failed("conversion", false, false, data->uuid, NULL);
|
||||
|
||||
total_tests++;
|
||||
|
@ -78,7 +78,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
|
|||
|
||||
/* BE */
|
||||
total_tests++;
|
||||
if (uuid_be_to_bin(data->uuid, &be))
|
||||
if (uuid_parse(data->uuid, &be))
|
||||
test_uuid_failed("conversion", false, true, data->uuid, NULL);
|
||||
|
||||
total_tests++;
|
||||
|
@ -90,17 +90,17 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
|
|||
|
||||
static void __init test_uuid_wrong(const char *data)
|
||||
{
|
||||
uuid_le le;
|
||||
uuid_be be;
|
||||
guid_t le;
|
||||
uuid_t be;
|
||||
|
||||
/* LE */
|
||||
total_tests++;
|
||||
if (!uuid_le_to_bin(data, &le))
|
||||
if (!guid_parse(data, &le))
|
||||
test_uuid_failed("negative", true, false, data, NULL);
|
||||
|
||||
/* BE */
|
||||
total_tests++;
|
||||
if (!uuid_be_to_bin(data, &be))
|
||||
if (!uuid_parse(data, &be))
|
||||
test_uuid_failed("negative", true, true, data, NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue