libnvdimm/labels: Add uuid helpers
[linux-2.6-microblaze.git] / drivers / nvdimm / btt.c
index 92dec49..52de60b 100644 (file)
@@ -973,7 +973,7 @@ static int btt_arena_write_layout(struct arena_info *arena)
        u64 sum;
        struct btt_sb *super;
        struct nd_btt *nd_btt = arena->nd_btt;
-       const u8 *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev);
+       const uuid_t *parent_uuid = nd_dev_to_uuid(&nd_btt->ndns->dev);
 
        ret = btt_map_init(arena);
        if (ret)
@@ -988,8 +988,8 @@ static int btt_arena_write_layout(struct arena_info *arena)
                return -ENOMEM;
 
        strncpy(super->signature, BTT_SIG, BTT_SIG_LEN);
-       memcpy(super->uuid, nd_btt->uuid, 16);
-       memcpy(super->parent_uuid, parent_uuid, 16);
+       export_uuid(super->uuid, nd_btt->uuid);
+       export_uuid(super->parent_uuid, parent_uuid);
        super->flags = cpu_to_le32(arena->flags);
        super->version_major = cpu_to_le16(arena->version_major);
        super->version_minor = cpu_to_le16(arena->version_minor);
@@ -1575,7 +1575,8 @@ static void btt_blk_cleanup(struct btt *btt)
  * Pointer to a new struct btt on success, NULL on failure.
  */
 static struct btt *btt_init(struct nd_btt *nd_btt, unsigned long long rawsize,
-               u32 lbasize, u8 *uuid, struct nd_region *nd_region)
+                           u32 lbasize, uuid_t *uuid,
+                           struct nd_region *nd_region)
 {
        int ret;
        struct btt *btt;
@@ -1694,7 +1695,7 @@ int nvdimm_namespace_attach_btt(struct nd_namespace_common *ndns)
        }
        nd_region = to_nd_region(nd_btt->dev.parent);
        btt = btt_init(nd_btt, rawsize, nd_btt->lbasize, nd_btt->uuid,
-                       nd_region);
+                      nd_region);
        if (!btt)
                return -ENOMEM;
        nd_btt->btt = btt;