Skip to contentSkip to conversation

zonefs: Replace uuid_copy() with import_uuid()

PATCH Applied Andy Shevchenko 4 participants 5 messages Apr 23, 2020 – Apr 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zonefs: Replace uuid_copy() with import_uuid()

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

---
 fs/zonefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/zonefs/super.c +1 -1
index dba874a61fc5c3..82af1f2bd8c85b 100644
@@ -1266,7 +1266,7 @@ static int zonefs_read_super(struct super_block *sb)
 		goto unmap;
 	}
 
-	uuid_copy(&sbi->s_uuid, (uuid_t *)super->s_uuid);
+	import_uuid(&sbi->s_uuid, super->s_uuid);
 	ret = 0;
 
 unmap:
Signature · 1 line
2.26.1
#2 lore raw
Quoted 7 lines · Chaitanya Kulkarni
Quoted 4 lines · Andy Shevchenko

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

At the end it does the same thing,

For now yes, who knows how uuid_t will look like in the future...

Quoted 1 line

I think we can avoid cast though.

This and possibility to change uuid_t if needed.

Quoted 1 line

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
In reply to Andy Shevchenko
Quoted 13 lines · Andy Shevchenko

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

---
 fs/zonefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/zonefs/super.c +0 -0
index dba874a61fc5c3..82af1f2bd8c85b 100644

fs/zonefs/super.c static int zonefs_read_super(struct super_block *sb) · line 1272

Quoted 8 lines
fs/zonefs/super.c +1 -1
@@ -1266,7 +1266,7 @@ static int zonefs_read_super(struct super_block *sb)
 		goto unmap;
 	}
 
-	uuid_copy(&sbi->s_uuid, (uuid_t *)super->s_uuid);
+	import_uuid(&sbi->s_uuid, super->s_uuid);
 	ret = 0;
 
 unmap:

Queued in for-5.8. Thanks !

Signature · 2 lines
Damien Le Moal
Western Digital Research