public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] zonefs: Replace uuid_copy() with import_uuid()
@ 2020-04-23 15:32 Andy Shevchenko
  2020-04-23 15:43 ` Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-04-23 15:32 UTC (permalink / raw)
  To: Damien Le Moal, Naohiro Aota, linux-fsdevel, Johannes Thumshirn
  Cc: 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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 fs/zonefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index dba874a61fc5c3..82af1f2bd8c85b 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -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:
-- 
2.26.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] zonefs: Replace uuid_copy() with import_uuid()
  2020-04-23 15:32 [PATCH v1] zonefs: Replace uuid_copy() with import_uuid() Andy Shevchenko
@ 2020-04-23 15:43 ` Chaitanya Kulkarni
  2020-04-23 15:51   ` Andy Shevchenko
  2020-04-23 16:41 ` Johannes Thumshirn
  2020-04-26 23:59 ` Damien Le Moal
  2 siblings, 1 reply; 5+ messages in thread
From: Chaitanya Kulkarni @ 2020-04-23 15:43 UTC (permalink / raw)
  To: Andy Shevchenko, Damien Le Moal, Naohiro Aota,
	linux-fsdevel@vger.kernel.org, Johannes Thumshirn

On 04/23/2020 08:32 AM, Andy Shevchenko wrote:
> There is a specific API to treat raw data as UUID, i.e. import_uuid().
> Use it instead of uuid_copy() with explicit casting.
>
> Signed-off-by: Andy Shevchenko<andriy.shevchenko@linux.intel.com>

At the end it does the same thing, I think we can avoid cast though.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] zonefs: Replace uuid_copy() with import_uuid()
  2020-04-23 15:43 ` Chaitanya Kulkarni
@ 2020-04-23 15:51   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2020-04-23 15:51 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: Damien Le Moal, Naohiro Aota, linux-fsdevel@vger.kernel.org,
	Johannes Thumshirn

On Thu, Apr 23, 2020 at 03:43:32PM +0000, Chaitanya Kulkarni wrote:
> On 04/23/2020 08:32 AM, Andy Shevchenko wrote:
> > There is a specific API to treat raw data as UUID, i.e. import_uuid().
> > Use it instead of uuid_copy() with explicit casting.
> >
> > Signed-off-by: Andy Shevchenko<andriy.shevchenko@linux.intel.com>
> 
> At the end it does the same thing,

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

> I think we can avoid cast though.

This and possibility to change uuid_t if needed.

> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] zonefs: Replace uuid_copy() with import_uuid()
  2020-04-23 15:32 [PATCH v1] zonefs: Replace uuid_copy() with import_uuid() Andy Shevchenko
  2020-04-23 15:43 ` Chaitanya Kulkarni
@ 2020-04-23 16:41 ` Johannes Thumshirn
  2020-04-26 23:59 ` Damien Le Moal
  2 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2020-04-23 16:41 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Damien Le Moal, Naohiro Aota, linux-fsdevel

On Thu, Apr 23, 2020 at 5:32 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> There is a specific API to treat raw data as UUID, i.e. import_uuid().
> Use it instead of uuid_copy() with explicit casting.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] zonefs: Replace uuid_copy() with import_uuid()
  2020-04-23 15:32 [PATCH v1] zonefs: Replace uuid_copy() with import_uuid() Andy Shevchenko
  2020-04-23 15:43 ` Chaitanya Kulkarni
  2020-04-23 16:41 ` Johannes Thumshirn
@ 2020-04-26 23:59 ` Damien Le Moal
  2 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2020-04-26 23:59 UTC (permalink / raw)
  To: andriy.shevchenko@linux.intel.com, jth@kernel.org,
	linux-fsdevel@vger.kernel.org, Naohiro Aota

On Thu, 2020-04-23 at 18:32 +0300, Andy Shevchenko wrote:
> There is a specific API to treat raw data as UUID, i.e. import_uuid().
> Use it instead of uuid_copy() with explicit casting.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  fs/zonefs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index dba874a61fc5c3..82af1f2bd8c85b 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -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 !

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-26 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-23 15:32 [PATCH v1] zonefs: Replace uuid_copy() with import_uuid() Andy Shevchenko
2020-04-23 15:43 ` Chaitanya Kulkarni
2020-04-23 15:51   ` Andy Shevchenko
2020-04-23 16:41 ` Johannes Thumshirn
2020-04-26 23:59 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox