blob: always rely on spdk_bs_open_blob in _spdk_bs_iter_cpl
We do not need to separately call _spdk_blob_lookup() in _spdk_bs_iter_cpl() - spdk_bs_open_blob() does this already. This minimizes the number of entry points to _spdk_blob_lookup() which will be important with some upcoming changes around multiple threads performing metadata operations. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I032cd55c862267298cbe1674dd13d7a83eef7c0f Reviewed-on: https://review.gerrithub.io/391474 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
0b99cd6f1e
commit
40af6d6fd1
@ -2948,7 +2948,6 @@ struct spdk_bs_iter_ctx {
|
||||
static void
|
||||
_spdk_bs_iter_cpl(void *cb_arg, struct spdk_blob *_blob, int bserrno)
|
||||
{
|
||||
struct spdk_blob_data *blob = __blob_to_data(_blob);
|
||||
struct spdk_bs_iter_ctx *ctx = cb_arg;
|
||||
struct spdk_blob_store *bs = ctx->bs;
|
||||
spdk_blob_id id;
|
||||
@ -2969,14 +2968,6 @@ _spdk_bs_iter_cpl(void *cb_arg, struct spdk_blob *_blob, int bserrno)
|
||||
|
||||
id = _spdk_bs_page_to_blobid(ctx->page_num);
|
||||
|
||||
blob = _spdk_blob_lookup(bs, id);
|
||||
if (blob) {
|
||||
blob->open_ref++;
|
||||
ctx->cb_fn(ctx->cb_arg, _blob, 0);
|
||||
free(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_bs_open_blob(bs, id, _spdk_bs_iter_cpl, ctx);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user