uuid: hoist helpers uuid_equal() and uuid_copy() from xfs

These helper are used to compare and copy two uuid_t type objects.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
[hch: also provide the respective guid_ versions]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Christoph Hellwig
2017-05-11 14:00:57 +02:00
parent b10bf0e281
commit df33767d9f
4 changed files with 22 additions and 15 deletions

View File

@@ -71,7 +71,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
test_uuid_failed("conversion", false, false, data->uuid, NULL);
total_tests++;
if (uuid_le_cmp(data->le, le)) {
if (!guid_equal(&data->le, &le)) {
sprintf(buf, "%pUl", &le);
test_uuid_failed("cmp", false, false, data->uuid, buf);
}
@@ -82,7 +82,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
test_uuid_failed("conversion", false, true, data->uuid, NULL);
total_tests++;
if (uuid_be_cmp(data->be, be)) {
if (uuid_equal(&data->be, &be)) {
sprintf(buf, "%pUb", &be);
test_uuid_failed("cmp", false, true, data->uuid, buf);
}