zonefs: Replace uuid_copy() with import_uuid()
Subsystems (2)
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
@@ -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
Quoted 4 lines · Andy Shevchenko
There is a specific API to treat raw data as UUID, i.e.
import_uuid(). Use it instead ofuuid_copy()with explicit casting.Signed-off-by Andy Shevchenko<[email protected]>
At the end it does the same thing, I think we can avoid cast though.
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 ofuuid_copy()with explicit casting.Signed-off-by Andy Shevchenko<[email protected]>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
Reviewed-by Chaitanya Kulkarni <[email protected]>
Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 5 lines · Andy Shevchenko
There is a specific API to treat raw data as UUID, i.e.
import_uuid(). Use it instead ofuuid_copy()with explicit casting.Signed-off-by Andy Shevchenko <[email protected]>
Looks good,
Damien Le Moal
AppliedQuoted 13 lines · Andy Shevchenko
There is a specific API to treat raw data as UUID, i.e.
import_uuid(). Use it instead ofuuid_copy()with explicit casting.Signed-off-by Andy Shevchenko <[email protected]>--- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/zonefs/super.c +0
-0
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