Commit 2da6293e authored by Tomasz Kulasek's avatar Tomasz Kulasek Committed by Daniel Verkamp
Browse files

lvol: add UUID to lvols snapshots and clones



See commit 8887697f ("bdev/lvol: add UUID to lvols")

Change-Id: I8b0c2678678588fc9ab85bfcf19fefffc0e26b0c
Signed-off-by: default avatarTomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/407300


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent be0eef0a
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1116,7 +1116,7 @@ spdk_lvol_create_snapshot(struct spdk_lvol *origlvol, const char *snapshot_name,
	struct spdk_blob *origblob;
	struct spdk_lvol_with_handle_req *req;
	struct spdk_blob_xattr_opts snapshot_xattrs;
	char *xattr_names = LVOL_NAME;
	char *xattr_names[] = {LVOL_NAME, "uuid"};
	int rc;

	if (origlvol == NULL) {
@@ -1150,9 +1150,11 @@ spdk_lvol_create_snapshot(struct spdk_lvol *origlvol, const char *snapshot_name,

	newlvol->lvol_store = origlvol->lvol_store;
	snprintf(newlvol->name, sizeof(newlvol->name), "%s", snapshot_name);
	snapshot_xattrs.count = 1;
	spdk_uuid_generate(&newlvol->uuid);
	spdk_uuid_fmt_lower(newlvol->uuid_str, sizeof(newlvol->uuid_str), &newlvol->uuid);
	snapshot_xattrs.count = SPDK_COUNTOF(xattr_names);
	snapshot_xattrs.ctx = newlvol;
	snapshot_xattrs.names = &xattr_names;
	snapshot_xattrs.names = xattr_names;
	snapshot_xattrs.get_value = spdk_lvol_get_xattr_value;
	req->lvol = newlvol;
	req->cb_fn = cb_fn;
@@ -1171,7 +1173,7 @@ spdk_lvol_create_clone(struct spdk_lvol *origlvol, const char *clone_name,
	struct spdk_lvol_store *lvs;
	struct spdk_blob *origblob;
	struct spdk_blob_xattr_opts clone_xattrs;
	char *xattr_names = LVOL_NAME;
	char *xattr_names[] = {LVOL_NAME, "uuid"};
	int rc;

	if (origlvol == NULL) {
@@ -1205,9 +1207,11 @@ spdk_lvol_create_clone(struct spdk_lvol *origlvol, const char *clone_name,

	newlvol->lvol_store = lvs;
	snprintf(newlvol->name, sizeof(newlvol->name), "%s", clone_name);
	clone_xattrs.count = 1;
	spdk_uuid_generate(&newlvol->uuid);
	spdk_uuid_fmt_lower(newlvol->uuid_str, sizeof(newlvol->uuid_str), &newlvol->uuid);
	clone_xattrs.count = SPDK_COUNTOF(xattr_names);
	clone_xattrs.ctx = newlvol;
	clone_xattrs.names = &xattr_names;
	clone_xattrs.names = xattr_names;
	clone_xattrs.get_value = spdk_lvol_get_xattr_value;
	req->lvol = newlvol;
	req->cb_fn = cb_fn;