ut/blob: always use local blobid
Always call API on blobid that was received from blob create, instead of relying on global one. Where necessary added declaration and assignment. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I3529b4d5e86c1301bb64268029a57873f9f600cb Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/944 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
114da5a203
commit
95ebed3c9e
@ -2937,6 +2937,7 @@ bs_usable_clusters(void)
|
||||
struct spdk_blob_store *bs = g_bs;
|
||||
struct spdk_blob_opts blob_opts;
|
||||
struct spdk_blob *blob;
|
||||
spdk_blob_id blobid;
|
||||
uint32_t clusters;
|
||||
int i;
|
||||
|
||||
@ -2956,10 +2957,11 @@ bs_usable_clusters(void)
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
|
||||
blobid = g_blobid;
|
||||
|
||||
g_bserrno = -1;
|
||||
g_blob = NULL;
|
||||
spdk_bs_open_blob(bs, g_blobid, blob_op_with_handle_complete, NULL);
|
||||
spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
CU_ASSERT(g_blob != NULL);
|
||||
@ -4447,14 +4449,14 @@ bs_load_iter(void)
|
||||
|
||||
g_bserrno = -1;
|
||||
g_blob = NULL;
|
||||
spdk_bs_open_blob(bs, g_blobid, blob_op_with_handle_complete, NULL);
|
||||
spdk_bs_open_blob(bs, iter_ctx.blobid[i], blob_op_with_handle_complete, NULL);
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
CU_ASSERT(g_blob != NULL);
|
||||
blob = g_blob;
|
||||
|
||||
/* Just save the blobid as an xattr for testing purposes. */
|
||||
rc = spdk_blob_set_xattr(blob, "blobid", &g_blobid, sizeof(g_blobid));
|
||||
rc = spdk_blob_set_xattr(blob, "blobid", &iter_ctx.blobid[i], sizeof(spdk_blob_id));
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
/* Resize the blob */
|
||||
|
Loading…
Reference in New Issue
Block a user