Linux-Block Archive on lore.kernel.org
 help / Atom feed
* [PATCH v1] : Switch to use new generic UUID API
@ 2019-01-10 14:30 Andy Shevchenko
  2019-01-21  8:47 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2019-01-10 14:30 UTC (permalink / raw)
  To: Matias Bjorling, linux-block, Christoph Hellwig, linux-kernel
  Cc: Andy Shevchenko

There are new types and helpers that are supposed to be used in new code.

As a preparation to get rid of legacy types and API functions do
the conversion here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/lightnvm/pblk.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 85e38ed62f85..0a0aeb6ef314 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -1362,10 +1362,7 @@ static inline unsigned int pblk_get_secs(struct bio *bio)
 
 static inline void pblk_setup_uuid(struct pblk *pblk)
 {
-	uuid_le uuid;
-
-	uuid_le_gen(&uuid);
-	memcpy(pblk->instance_uuid, uuid.b, 16);
+	guid_gen((guid_t *)&pblk->instance_uuid);
 }
 
 static inline char *pblk_disk_name(struct pblk *pblk)
-- 
2.20.1


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

* Re: [PATCH v1] : Switch to use new generic UUID API
  2019-01-10 14:30 [PATCH v1] : Switch to use new generic UUID API Andy Shevchenko
@ 2019-01-21  8:47 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2019-01-21  8:47 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Matias Bjorling, linux-block, Christoph Hellwig, linux-kernel

On Thu, Jan 10, 2019 at 04:30:51PM +0200, Andy Shevchenko wrote:
> There are new types and helpers that are supposed to be used in new code.
> 
> As a preparation to get rid of legacy types and API functions do
> the conversion here.

This seems to miss a "lightnvm" in the subject line.

>  static inline void pblk_setup_uuid(struct pblk *pblk)
>  {
> +	guid_gen((guid_t *)&pblk->instance_uuid);
>  }

I think we can just kill this wrapper.

But more importantly the instance_uuid fied, and the header.uuid one
it is copied from should be turned into an actual guid_t, the memcpys
and memcmps should also be replaced with the proper UUID API.

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 14:30 [PATCH v1] : Switch to use new generic UUID API Andy Shevchenko
2019-01-21  8:47 ` Christoph Hellwig

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox