Skip to content

Commit 22c778b

Browse files
committed
update 2
1 parent 6eecaa4 commit 22c778b

3 files changed

Lines changed: 11 additions & 17 deletions

File tree

include/spdk/blob.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ typedef void (*spdk_blob_shallow_copy_status)(uint64_t copied_clusters, uint64_t
162162
/**
163163
* Blob deep copy status callback.
164164
*
165-
* \param copied_clusters Actual number of copied clusters by the deep copy operation
165+
* \param processed_clusters Number of processed clusters by the deep copy operation
166166
* \param cb_arg Callback argument.
167167
*/
168-
typedef void (*spdk_blob_deep_copy_status)(uint64_t copied_clusters,
168+
typedef void (*spdk_blob_deep_copy_status)(uint64_t processed_clusters,
169169
void *cb_arg);
170170

171171
/**

lib/blob/blobstore.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7892,10 +7892,6 @@ struct deep_copy_ctx {
78927892
/* Struct for external device writing */
78937893
struct spdk_bs_dev_cb_args ext_args;
78947894

7895-
// TODO: how to determine this
7896-
/* Actual number of copied clusters */
7897-
uint64_t copied_clusters_count;
7898-
78997895
/* Status callback for updates about the ongoing operation */
79007896
spdk_blob_deep_copy_status status_cb;
79017897

@@ -7937,8 +7933,6 @@ bs_deep_copy_bdev_write_cpl(struct spdk_io_channel *channel, void *cb_arg, int b
79377933
}
79387934

79397935
if (ctx->status_cb) {
7940-
// TODO: How to determine this
7941-
// ctx->copied_clusters_count++;
79427936
ctx->status_cb(ctx->cluster, ctx->status_cb_arg);
79437937
}
79447938

module/bdev/lvol/vbdev_lvol_rpc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct rpc_deep_copy_status {
4141
* a negative value is the -errno of an aborted operation
4242
*/
4343
int result;
44-
uint64_t copied_clusters;
44+
uint64_t processed_clusters;
4545
uint64_t total_clusters;
4646
LIST_ENTRY(rpc_deep_copy_status) link;
4747
};
@@ -1972,12 +1972,12 @@ rpc_bdev_lvol_deep_copy_cb(void *cb_arg, int lvolerrno)
19721972
}
19731973

19741974
static void
1975-
rpc_bdev_lvol_deep_copy_status_cb(uint64_t copied_clusters,
1975+
rpc_bdev_lvol_deep_copy_status_cb(uint64_t processed_clusters,
19761976
void *cb_arg)
19771977
{
19781978
struct rpc_deep_copy_status *status = cb_arg;
19791979

1980-
status->copied_clusters = copied_clusters;
1980+
status->processed_clusters = processed_clusters;
19811981
}
19821982

19831983

@@ -2025,7 +2025,7 @@ rpc_bdev_lvol_start_deep_copy(struct spdk_jsonrpc_request *request,
20252025
goto cleanup;
20262026
}
20272027

2028-
status->operation_id = ++g_shallow_copy_count;
2028+
status->operation_id = ++g_deep_copy_count;
20292029
status->total_clusters = spdk_blob_get_num_clusters(src_lvol->blob);
20302030

20312031
ctx = calloc(1, sizeof(*ctx));
@@ -2088,7 +2088,7 @@ rpc_bdev_lvol_check_deep_copy(struct spdk_jsonrpc_request *request,
20882088
struct rpc_bdev_lvol_deep_copy_status req = {};
20892089
struct rpc_deep_copy_status *status;
20902090
struct spdk_json_write_ctx *w;
2091-
uint64_t copied_clusters, total_clusters;
2091+
uint64_t processed_clusters, total_clusters;
20922092
int result;
20932093

20942094
SPDK_INFOLOG(lvol_rpc, "Deep copy check\n");
@@ -2114,19 +2114,19 @@ rpc_bdev_lvol_check_deep_copy(struct spdk_jsonrpc_request *request,
21142114
goto cleanup;
21152115
}
21162116

2117-
copied_clusters = status->copied_clusters;
2117+
processed_clusters = status->processed_clusters;
21182118
total_clusters = status->total_clusters;
21192119
result = status->result;
21202120

21212121
w = spdk_jsonrpc_begin_result(request);
21222122

21232123
spdk_json_write_object_begin(w);
21242124

2125-
spdk_json_write_named_uint64(w, "copied_clusters", copied_clusters);
2125+
spdk_json_write_named_uint64(w, "processed_clusters", processed_clusters);
21262126
spdk_json_write_named_uint64(w, "total_clusters", total_clusters);
2127-
if (copied_clusters < total_clusters && result == 0) {
2127+
if (processed_clusters < total_clusters && result == 0) {
21282128
spdk_json_write_named_string(w, "state", "in progress");
2129-
} else if (copied_clusters == total_clusters && result == 0) {
2129+
} else if (processed_clusters == total_clusters && result == 0) {
21302130
spdk_json_write_named_string(w, "state", "complete");
21312131
LIST_REMOVE(status, link);
21322132
free(status);

0 commit comments

Comments
 (0)