]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sun, 14 Feb 2021 10:31:03 +0000 (10:31 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Feb 2021 04:27:24 +0000 (21:27 -0700)
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>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-recovery.c

index 1dddba11e72123be5fb56e4199052161ade30f8d..33d39d3dd3433abcfba788049f88cb69934d0cf2 100644 (file)
@@ -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;
index 299ef47a17b22ae56747b824961c029691e6fc8a..0e6f0c76e93027a83517b69e8d0f7e1f3ecd6f06 100644 (file)
@@ -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;
                }