blob: claim clusters inline during initialization
When claiming clusters as part of blobstore initialization or recovery, just call spdk_bit_array_set directly rather than going through the bs_claim_cluster function. We will be modifying how runtime cluster allocation works so need to separate the two use cases. This code is very small so inlining it has minimal code impact. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Iaaa1c817e57b4a2eea62eb4683407364bac1fcc0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3966 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
b7d508f5e5
commit
2d87587fe5
@ -3903,8 +3903,9 @@ bs_load_replay_md_chain_cpl(struct spdk_bs_load_ctx *ctx)
|
||||
/* Claim all of the clusters used by the metadata */
|
||||
num_md_clusters = spdk_divide_round_up(ctx->super->md_len, ctx->bs->pages_per_cluster);
|
||||
for (i = 0; i < num_md_clusters; i++) {
|
||||
bs_claim_cluster(ctx->bs, i);
|
||||
spdk_bit_array_set(ctx->bs->used_clusters, i);
|
||||
}
|
||||
ctx->bs->num_free_clusters -= num_md_clusters;
|
||||
spdk_free(ctx->page);
|
||||
bs_load_write_used_md(ctx);
|
||||
}
|
||||
@ -4709,9 +4710,10 @@ spdk_bs_init(struct spdk_bs_dev *dev, struct spdk_bs_opts *o,
|
||||
}
|
||||
/* Claim all of the clusters used by the metadata */
|
||||
for (i = 0; i < num_md_clusters; i++) {
|
||||
bs_claim_cluster(bs, i);
|
||||
spdk_bit_array_set(bs->used_clusters, i);
|
||||
}
|
||||
|
||||
bs->num_free_clusters -= num_md_clusters;
|
||||
bs->total_data_clusters = bs->num_free_clusters;
|
||||
|
||||
cpl.type = SPDK_BS_CPL_TYPE_BS_HANDLE;
|
||||
|
Loading…
Reference in New Issue
Block a user