linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v1] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid()
Date: Sun, 14 Feb 2021 11:32:22 +0100	[thread overview]
Message-ID: <beb04551-110d-3646-faf9-7fc4ae8d2bdf@lightnvm.io> (raw)
In-Reply-To: <20210209164219.53849-1-andriy.shevchenko@linux.intel.com>

On 09/02/2021 17.42, Andy Shevchenko wrote:
> There is a specific API to treat raw data as GUID, i.e. export_guid()
> and import_guid(). Use them instead of guid_copy() with explicit casting.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/lightnvm/pblk-core.c     | 5 ++---
>   drivers/lightnvm/pblk-recovery.c | 3 +--
>   2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 1dddba11e721..33d39d3dd343 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -988,7 +988,7 @@ static int pblk_line_init_metadata(struct pblk *pblk, struct pblk_line *line,
>   	bitmap_set(line->lun_bitmap, 0, lm->lun_bitmap_len);
>   
>   	smeta_buf->header.identifier = cpu_to_le32(PBLK_MAGIC);
> -	guid_copy((guid_t *)&smeta_buf->header.uuid, &pblk->instance_uuid);
> +	export_guid(smeta_buf->header.uuid, &pblk->instance_uuid);
>   	smeta_buf->header.id = cpu_to_le32(line->id);
>   	smeta_buf->header.type = cpu_to_le16(line->type);
>   	smeta_buf->header.version_major = SMETA_VERSION_MAJOR;
> @@ -1803,8 +1803,7 @@ void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line)
>   
>   	if (le32_to_cpu(emeta_buf->header.identifier) != PBLK_MAGIC) {
>   		emeta_buf->header.identifier = cpu_to_le32(PBLK_MAGIC);
> -		guid_copy((guid_t *)&emeta_buf->header.uuid,
> -							&pblk->instance_uuid);
> +		export_guid(emeta_buf->header.uuid, &pblk->instance_uuid);
>   		emeta_buf->header.id = cpu_to_le32(line->id);
>   		emeta_buf->header.type = cpu_to_le16(line->type);
>   		emeta_buf->header.version_major = EMETA_VERSION_MAJOR;
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index 299ef47a17b2..0e6f0c76e930 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -706,8 +706,7 @@ struct pblk_line *pblk_recov_l2p(struct pblk *pblk)
>   
>   		/* The first valid instance uuid is used for initialization */
>   		if (!valid_uuid) {
> -			guid_copy(&pblk->instance_uuid,
> -				  (guid_t *)&smeta_buf->header.uuid);
> +			import_guid(&pblk->instance_uuid, smeta_buf->header.uuid);
>   			valid_uuid = 1;
>   		}
>   

Thanks, Andy. I've pulled it.


  reply	other threads:[~2021-02-14 10:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 16:42 [PATCH v1] lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() Andy Shevchenko
2021-02-14 10:32 ` Matias Bjørling [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-22 13:06 Andy Shevchenko
2020-06-18 10:57 ` Andy Shevchenko
2020-06-18 11:14   ` Matias Bjørling
2020-06-18 15:17     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=beb04551-110d-3646-faf9-7fc4ae8d2bdf@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).