Commit 8256cecf authored by Maciej Szwed's avatar Maciej Szwed Committed by Jim Harris
Browse files

blobstore: rename resize_in_progress to locked_operation_in_progress



This is a part of future changes to block blob operations
that may cause race conditions between each other.

Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia728d1fc207375ddcb3b70b5081ddcffa9f99027

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449789


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 6e947d19
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4889,7 +4889,7 @@ _spdk_bs_resize_unfreeze_cpl(void *cb_arg, int rc)
		rc = ctx->rc;
	}

	ctx->blob->resize_in_progress = false;
	ctx->blob->locked_operation_in_progress = false;

	ctx->cb_fn(ctx->cb_arg, rc);
	free(ctx);
@@ -4901,7 +4901,7 @@ _spdk_bs_resize_freeze_cpl(void *cb_arg, int rc)
	struct spdk_bs_resize_ctx *ctx = (struct spdk_bs_resize_ctx *)cb_arg;

	if (rc != 0) {
		ctx->blob->resize_in_progress = false;
		ctx->blob->locked_operation_in_progress = false;
		ctx->cb_fn(ctx->cb_arg, rc);
		free(ctx);
		return;
@@ -4931,7 +4931,7 @@ spdk_blob_resize(struct spdk_blob *blob, uint64_t sz, spdk_blob_op_complete cb_f
		return;
	}

	if (blob->resize_in_progress) {
	if (blob->locked_operation_in_progress) {
		cb_fn(cb_arg, -EBUSY);
		return;
	}
@@ -4942,7 +4942,7 @@ spdk_blob_resize(struct spdk_blob *blob, uint64_t sz, spdk_blob_op_complete cb_f
		return;
	}

	blob->resize_in_progress = true;
	blob->locked_operation_in_progress = true;
	ctx->cb_fn = cb_fn;
	ctx->cb_arg = cb_arg;
	ctx->blob = blob;
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ struct spdk_blob {
	TAILQ_ENTRY(spdk_blob) link;

	uint32_t frozen_refcnt;
	bool resize_in_progress;
	bool locked_operation_in_progress;
	enum blob_clear_method clear_method;
};