blob: rename bs_md functions

As part of clarifying the API and preparing for some
future changes, rename the following functions:

spdk_bs_md_create_blob => spdk_bs_create_blob
spdk_bs_md_open_blob => spdk_bs_open_blob
spdk_bs_md_delete_blob => spdk_bs_delete_blob
spdk_bs_md_iter_first => spdk_bs_iter_first
spdk_bs_md_iter_next => spdk_bs_iter_next

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I86bf792717b68379484a6108396bb891fe1c221e

Reviewed-on: https://review.gerrithub.io/391031
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2017-12-08 14:09:12 -07:00 committed by Daniel Verkamp
parent 7932847300
commit d52dbda288
9 changed files with 160 additions and 157 deletions

View File

@ -46,6 +46,11 @@ spdk_bs_md_get_xattr_names => spdk_blob_get_xattr_names
spdk_bs_md_get_xattr_value => spdk_blob_get_xattr_value spdk_bs_md_get_xattr_value => spdk_blob_get_xattr_value
spdk_blob_md_set_xattr => spdk_blob_set_xattr spdk_blob_md_set_xattr => spdk_blob_set_xattr
spdk_blob_md_remove_xattr => spdk_blob_remove_xattr spdk_blob_md_remove_xattr => spdk_blob_remove_xattr
spdk_bs_md_create_blob => spdk_bs_create_blob
spdk_bs_md_open_blob => spdk_bs_open_blob
spdk_bs_md_delete_blob => spdk_bs_delete_blob
spdk_bs_md_iter_first => spdk_bs_iter_first
spdk_bs_md_iter_next => spdk_bs_iter_next
## v17.10: Logical Volumes ## v17.10: Logical Volumes

View File

@ -347,8 +347,8 @@ blob_create_cb(void *arg1, spdk_blob_id blobid, int bserrno)
} }
/* We have to open the blob before we can do things like resize. */ /* We have to open the blob before we can do things like resize. */
spdk_bs_md_open_blob(cli_context->bs, cli_context->blobid, spdk_bs_open_blob(cli_context->bs, cli_context->blobid,
open_now_resize_cb, cli_context); open_now_resize_cb, cli_context);
} }
/* /*
@ -519,8 +519,7 @@ blob_iter_cb(void *arg1, struct spdk_blob *blob, int bserrno)
show_blob(cli_context); show_blob(cli_context);
} }
spdk_bs_md_iter_next(cli_context->bs, &blob, blob_iter_cb, spdk_bs_iter_next(cli_context->bs, &blob, blob_iter_cb, cli_context);
cli_context);
} }
/* /*
@ -822,27 +821,26 @@ load_bs_cb(void *arg1, struct spdk_blob_store *bs, int bserrno)
spdk_bs_get_super(cli_context->bs, show_bs_cb, cli_context); spdk_bs_get_super(cli_context->bs, show_bs_cb, cli_context);
break; break;
case CLI_CREATE_BLOB: case CLI_CREATE_BLOB:
spdk_bs_md_create_blob(cli_context->bs, blob_create_cb, spdk_bs_create_blob(cli_context->bs, blob_create_cb, cli_context);
cli_context);
break; break;
case CLI_SET_XATTR: case CLI_SET_XATTR:
case CLI_REM_XATTR: case CLI_REM_XATTR:
spdk_bs_md_open_blob(cli_context->bs, cli_context->blobid, spdk_bs_open_blob(cli_context->bs, cli_context->blobid,
set_xattr_cb, cli_context); set_xattr_cb, cli_context);
break; break;
case CLI_SHOW_BLOB: case CLI_SHOW_BLOB:
case CLI_LIST_BLOBS: case CLI_LIST_BLOBS:
spdk_bs_md_iter_first(cli_context->bs, blob_iter_cb, cli_context); spdk_bs_iter_first(cli_context->bs, blob_iter_cb, cli_context);
break; break;
case CLI_DUMP_BLOB: case CLI_DUMP_BLOB:
case CLI_IMPORT_BLOB: case CLI_IMPORT_BLOB:
spdk_bs_md_open_blob(cli_context->bs, cli_context->blobid, spdk_bs_open_blob(cli_context->bs, cli_context->blobid,
dump_imp_open_cb, cli_context); dump_imp_open_cb, cli_context);
break; break;
case CLI_FILL: case CLI_FILL:
spdk_bs_md_open_blob(cli_context->bs, cli_context->blobid, spdk_bs_open_blob(cli_context->bs, cli_context->blobid,
fill_blob_cb, cli_context); fill_blob_cb, cli_context);
break; break;
default: default:

View File

@ -137,8 +137,8 @@ delete_blob(void *arg1, int bserrno)
return; return;
} }
spdk_bs_md_delete_blob(hello_context->bs, hello_context->blobid, spdk_bs_delete_blob(hello_context->bs, hello_context->blobid,
delete_complete, hello_context); delete_complete, hello_context);
} }
/* /*
@ -339,8 +339,8 @@ blob_create_complete(void *arg1, spdk_blob_id blobid, int bserrno)
SPDK_NOTICELOG("new blob id %" PRIu64 "\n", hello_context->blobid); SPDK_NOTICELOG("new blob id %" PRIu64 "\n", hello_context->blobid);
/* We have to open the blob before we can do things like resize. */ /* We have to open the blob before we can do things like resize. */
spdk_bs_md_open_blob(hello_context->bs, hello_context->blobid, spdk_bs_open_blob(hello_context->bs, hello_context->blobid,
open_complete, hello_context); open_complete, hello_context);
} }
/* /*
@ -350,8 +350,7 @@ static void
create_blob(struct hello_context_t *hello_context) create_blob(struct hello_context_t *hello_context)
{ {
SPDK_NOTICELOG("entry\n"); SPDK_NOTICELOG("entry\n");
spdk_bs_md_create_blob(hello_context->bs, blob_create_complete, spdk_bs_create_blob(hello_context->bs, blob_create_complete, hello_context);
hello_context);
} }
/* /*

View File

@ -207,16 +207,16 @@ uint64_t spdk_blob_get_num_pages(struct spdk_blob *blob);
uint64_t spdk_blob_get_num_clusters(struct spdk_blob *blob); uint64_t spdk_blob_get_num_clusters(struct spdk_blob *blob);
/* Create a new blob with initial size of 'sz' clusters. */ /* Create a new blob with initial size of 'sz' clusters. */
void spdk_bs_md_create_blob(struct spdk_blob_store *bs, void spdk_bs_create_blob(struct spdk_blob_store *bs,
spdk_blob_op_with_id_complete cb_fn, void *cb_arg); spdk_blob_op_with_id_complete cb_fn, void *cb_arg);
/* Delete an existing blob. */ /* Delete an existing blob. */
void spdk_bs_md_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, void spdk_bs_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_complete cb_fn, void *cb_arg); spdk_blob_op_complete cb_fn, void *cb_arg);
/* Open a blob */ /* Open a blob */
void spdk_bs_md_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, void spdk_bs_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg); spdk_blob_op_with_handle_complete cb_fn, void *cb_arg);
/* Resize a blob to 'sz' clusters. /* Resize a blob to 'sz' clusters.
* *
@ -267,10 +267,10 @@ void spdk_bs_io_write_zeroes_blob(struct spdk_blob *blob, struct spdk_io_channel
uint64_t offset, uint64_t length, spdk_blob_op_complete cb_fn, void *cb_arg); uint64_t offset, uint64_t length, spdk_blob_op_complete cb_fn, void *cb_arg);
/* Iterate through all blobs */ /* Iterate through all blobs */
void spdk_bs_md_iter_first(struct spdk_blob_store *bs, void spdk_bs_iter_first(struct spdk_blob_store *bs,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg); spdk_blob_op_with_handle_complete cb_fn, void *cb_arg);
void spdk_bs_md_iter_next(struct spdk_blob_store *bs, struct spdk_blob **blob, void spdk_bs_iter_next(struct spdk_blob_store *bs, struct spdk_blob **blob,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg); spdk_blob_op_with_handle_complete cb_fn, void *cb_arg);
int spdk_blob_set_xattr(struct spdk_blob *blob, const char *name, const void *value, int spdk_blob_set_xattr(struct spdk_blob *blob, const char *name, const void *value,
uint16_t value_len); uint16_t value_len);

View File

@ -2582,10 +2582,10 @@ uint64_t spdk_blob_get_num_clusters(struct spdk_blob *_blob)
return blob->active.num_clusters; return blob->active.num_clusters;
} }
/* START spdk_bs_md_create_blob */ /* START spdk_bs_create_blob */
static void static void
_spdk_bs_md_create_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) _spdk_bs_create_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
{ {
struct spdk_blob_data *blob = cb_arg; struct spdk_blob_data *blob = cb_arg;
@ -2594,8 +2594,8 @@ _spdk_bs_md_create_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
spdk_bs_sequence_finish(seq, bserrno); spdk_bs_sequence_finish(seq, bserrno);
} }
void spdk_bs_md_create_blob(struct spdk_blob_store *bs, void spdk_bs_create_blob(struct spdk_blob_store *bs,
spdk_blob_op_with_id_complete cb_fn, void *cb_arg) spdk_blob_op_with_id_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob_data *blob; struct spdk_blob_data *blob;
uint32_t page_idx; uint32_t page_idx;
@ -2632,10 +2632,10 @@ void spdk_bs_md_create_blob(struct spdk_blob_store *bs,
return; return;
} }
_spdk_blob_persist(seq, blob, _spdk_bs_md_create_blob_cpl, blob); _spdk_blob_persist(seq, blob, _spdk_bs_create_blob_cpl, blob);
} }
/* END spdk_bs_md_create_blob */ /* END spdk_bs_create_blob */
/* START spdk_blob_resize */ /* START spdk_blob_resize */
int int
@ -2667,10 +2667,10 @@ spdk_blob_resize(struct spdk_blob *_blob, uint64_t sz)
/* END spdk_blob_resize */ /* END spdk_blob_resize */
/* START spdk_bs_md_delete_blob */ /* START spdk_bs_delete_blob */
static void static void
_spdk_bs_md_delete_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) _spdk_bs_delete_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
{ {
struct spdk_blob_data *blob = cb_arg; struct spdk_blob_data *blob = cb_arg;
@ -2680,7 +2680,7 @@ _spdk_bs_md_delete_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
} }
static void static void
_spdk_bs_md_delete_open_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) _spdk_bs_delete_open_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
{ {
struct spdk_blob_data *blob = cb_arg; struct spdk_blob_data *blob = cb_arg;
@ -2693,12 +2693,12 @@ _spdk_bs_md_delete_open_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
blob->active.num_pages = 0; blob->active.num_pages = 0;
_spdk_resize_blob(blob, 0); _spdk_resize_blob(blob, 0);
_spdk_blob_persist(seq, blob, _spdk_bs_md_delete_blob_cpl, blob); _spdk_blob_persist(seq, blob, _spdk_bs_delete_blob_cpl, blob);
} }
void void
spdk_bs_md_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, spdk_bs_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_complete cb_fn, void *cb_arg) spdk_blob_op_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob_data *blob; struct spdk_blob_data *blob;
struct spdk_bs_cpl cpl; struct spdk_bs_cpl cpl;
@ -2730,15 +2730,15 @@ spdk_bs_md_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
return; return;
} }
_spdk_blob_load(seq, blob, _spdk_bs_md_delete_open_cpl, blob); _spdk_blob_load(seq, blob, _spdk_bs_delete_open_cpl, blob);
} }
/* END spdk_bs_md_delete_blob */ /* END spdk_bs_delete_blob */
/* START spdk_bs_md_open_blob */ /* START spdk_bs_open_blob */
static void static void
_spdk_bs_md_open_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) _spdk_bs_open_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
{ {
struct spdk_blob_data *blob = cb_arg; struct spdk_blob_data *blob = cb_arg;
@ -2756,8 +2756,8 @@ _spdk_bs_md_open_blob_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
spdk_bs_sequence_finish(seq, bserrno); spdk_bs_sequence_finish(seq, bserrno);
} }
void spdk_bs_md_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, void spdk_bs_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob_data *blob; struct spdk_blob_data *blob;
struct spdk_bs_cpl cpl; struct spdk_bs_cpl cpl;
@ -2798,10 +2798,13 @@ void spdk_bs_md_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
return; return;
} }
_spdk_blob_load(seq, blob, _spdk_bs_md_open_blob_cpl, blob); _spdk_blob_load(seq, blob, _spdk_bs_open_blob_cpl, blob);
} }
/* END spdk_bs_open_blob */
/* START spdk_blob_sync_md */ /* START spdk_blob_sync_md */
static void static void
_spdk_blob_sync_md_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) _spdk_blob_sync_md_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
{ {
@ -3001,12 +3004,12 @@ _spdk_bs_iter_cpl(void *cb_arg, struct spdk_blob *_blob, int bserrno)
return; return;
} }
spdk_bs_md_open_blob(bs, id, _spdk_bs_iter_cpl, ctx); spdk_bs_open_blob(bs, id, _spdk_bs_iter_cpl, ctx);
} }
void void
spdk_bs_md_iter_first(struct spdk_blob_store *bs, spdk_bs_iter_first(struct spdk_blob_store *bs,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_bs_iter_ctx *ctx; struct spdk_bs_iter_ctx *ctx;
@ -3033,8 +3036,8 @@ _spdk_bs_iter_close_cpl(void *cb_arg, int bserrno)
} }
void void
spdk_bs_md_iter_next(struct spdk_blob_store *bs, struct spdk_blob **b, spdk_bs_iter_next(struct spdk_blob_store *bs, struct spdk_blob **b,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_bs_iter_ctx *ctx; struct spdk_bs_iter_ctx *ctx;
struct spdk_blob_data *blob; struct spdk_blob_data *blob;

View File

@ -530,7 +530,7 @@ _handle_deleted_files(struct spdk_fs_request *req)
deleted_file = TAILQ_FIRST(&args->op.fs_load.deleted_files); deleted_file = TAILQ_FIRST(&args->op.fs_load.deleted_files);
TAILQ_REMOVE(&args->op.fs_load.deleted_files, deleted_file, tailq); TAILQ_REMOVE(&args->op.fs_load.deleted_files, deleted_file, tailq);
spdk_bs_md_delete_blob(fs->bs, deleted_file->id, iter_delete_cb, req); spdk_bs_delete_blob(fs->bs, deleted_file->id, iter_delete_cb, req);
free(deleted_file); free(deleted_file);
return 0; return 0;
} }
@ -626,7 +626,7 @@ iter_cb(void *ctx, struct spdk_blob *blob, int rc)
TAILQ_INSERT_TAIL(&args->op.fs_load.deleted_files, deleted_file, tailq); TAILQ_INSERT_TAIL(&args->op.fs_load.deleted_files, deleted_file, tailq);
} }
spdk_bs_md_iter_next(fs->bs, &blob, iter_cb, req); spdk_bs_iter_next(fs->bs, &blob, iter_cb, req);
} }
static void static void
@ -661,7 +661,7 @@ load_cb(void *ctx, struct spdk_blob_store *bs, int bserrno)
} }
common_fs_bs_init(fs, bs); common_fs_bs_init(fs, bs);
spdk_bs_md_iter_first(fs->bs, iter_cb, req); spdk_bs_iter_first(fs->bs, iter_cb, req);
} }
void void
@ -873,7 +873,7 @@ fs_create_blob_create_cb(void *ctx, spdk_blob_id blobid, int bserrno)
struct spdk_file *f = args->file; struct spdk_file *f = args->file;
f->blobid = blobid; f->blobid = blobid;
spdk_bs_md_open_blob(f->fs->bs, blobid, fs_create_blob_open_cb, req); spdk_bs_open_blob(f->fs->bs, blobid, fs_create_blob_open_cb, req);
} }
void void
@ -913,7 +913,7 @@ spdk_fs_create_file_async(struct spdk_filesystem *fs, const char *name,
args->arg = cb_arg; args->arg = cb_arg;
file->name = strdup(name); file->name = strdup(name);
spdk_bs_md_create_blob(fs->bs, fs_create_blob_create_cb, args); spdk_bs_create_blob(fs->bs, fs_create_blob_create_cb, args);
} }
static void static void
@ -1002,7 +1002,7 @@ fs_open_blob_create_cb(void *ctx, int bserrno)
TAILQ_INSERT_TAIL(&file->open_requests, req, args.op.open.tailq); TAILQ_INSERT_TAIL(&file->open_requests, req, args.op.open.tailq);
if (file->ref_count == 1) { if (file->ref_count == 1) {
assert(file->blob == NULL); assert(file->blob == NULL);
spdk_bs_md_open_blob(fs->bs, file->blobid, fs_open_blob_done, req); spdk_bs_open_blob(fs->bs, file->blobid, fs_open_blob_done, req);
} else if (file->blob != NULL) { } else if (file->blob != NULL) {
fs_open_blob_done(req, file->blob, 0); fs_open_blob_done(req, file->blob, 0);
} else { } else {
@ -1152,7 +1152,7 @@ __spdk_fs_md_rename_file(struct spdk_fs_request *req)
free(f->name); free(f->name);
f->name = strdup(args->op.rename.new_name); f->name = strdup(args->op.rename.new_name);
args->file = f; args->file = f;
spdk_bs_md_open_blob(args->fs->bs, f->blobid, fs_rename_blob_open_cb, req); spdk_bs_open_blob(args->fs->bs, f->blobid, fs_rename_blob_open_cb, req);
} }
static void static void
@ -1307,7 +1307,7 @@ spdk_fs_delete_file_async(struct spdk_filesystem *fs, const char *name,
free(f->tree); free(f->tree);
free(f); free(f);
spdk_bs_md_delete_blob(fs->bs, blobid, blob_delete_cb, req); spdk_bs_delete_blob(fs->bs, blobid, blob_delete_cb, req);
} }
static void static void

View File

@ -135,7 +135,7 @@ spdk_lvol_open(struct spdk_lvol *lvol, spdk_lvol_op_with_handle_complete cb_fn,
req->cb_arg = cb_arg; req->cb_arg = cb_arg;
req->lvol = lvol; req->lvol = lvol;
spdk_bs_md_open_blob(lvol->lvol_store->blobstore, lvol->blob_id, _spdk_lvol_open_cb, req); spdk_bs_open_blob(lvol->lvol_store->blobstore, lvol->blob_id, _spdk_lvol_open_cb, req);
} }
static void static void
@ -175,7 +175,7 @@ _spdk_load_next_lvol(void *cb_arg, struct spdk_blob *blob, int lvolerrno)
if (blob_id == lvs->super_blob_id) { if (blob_id == lvs->super_blob_id) {
SPDK_INFOLOG(SPDK_LOG_LVOL, "found superblob %"PRIu64"\n", (uint64_t)blob_id); SPDK_INFOLOG(SPDK_LOG_LVOL, "found superblob %"PRIu64"\n", (uint64_t)blob_id);
spdk_bs_md_iter_next(bs, &blob, _spdk_load_next_lvol, req); spdk_bs_iter_next(bs, &blob, _spdk_load_next_lvol, req);
return; return;
} }
@ -217,7 +217,7 @@ _spdk_load_next_lvol(void *cb_arg, struct spdk_blob *blob, int lvolerrno)
SPDK_INFOLOG(SPDK_LOG_LVOL, "added lvol %s\n", lvol->old_name); SPDK_INFOLOG(SPDK_LOG_LVOL, "added lvol %s\n", lvol->old_name);
spdk_bs_md_iter_next(bs, &blob, _spdk_load_next_lvol, req); spdk_bs_iter_next(bs, &blob, _spdk_load_next_lvol, req);
return; return;
@ -248,7 +248,7 @@ _spdk_close_super_cb(void *cb_arg, int lvolerrno)
} }
/* Start loading lvols */ /* Start loading lvols */
spdk_bs_md_iter_first(lvs->blobstore, _spdk_load_next_lvol, req); spdk_bs_iter_first(lvs->blobstore, _spdk_load_next_lvol, req);
} }
static void static void
@ -334,7 +334,7 @@ _spdk_lvs_open_super(void *cb_arg, spdk_blob_id blobid, int lvolerrno)
return; return;
} }
spdk_bs_md_open_blob(bs, blobid, _spdk_lvs_read_uuid, req); spdk_bs_open_blob(bs, blobid, _spdk_lvs_read_uuid, req);
} }
static void static void
@ -492,7 +492,7 @@ _spdk_super_blob_create_cb(void *cb_arg, spdk_blob_id blobid, int lvolerrno)
bs = req->lvol_store->blobstore; bs = req->lvol_store->blobstore;
spdk_bs_md_open_blob(bs, blobid, _spdk_super_blob_create_open_cb, req); spdk_bs_open_blob(bs, blobid, _spdk_super_blob_create_open_cb, req);
} }
static void static void
@ -517,7 +517,7 @@ _spdk_lvs_init_cb(void *cb_arg, struct spdk_blob_store *bs, int lvserrno)
SPDK_INFOLOG(SPDK_LOG_LVOL, "Lvol store initialized\n"); SPDK_INFOLOG(SPDK_LOG_LVOL, "Lvol store initialized\n");
/* create super blob */ /* create super blob */
spdk_bs_md_create_blob(lvs->blobstore, _spdk_super_blob_create_cb, lvs_req); spdk_bs_create_blob(lvs->blobstore, _spdk_super_blob_create_cb, lvs_req);
} }
void void
@ -738,7 +738,7 @@ spdk_lvs_destroy(struct spdk_lvol_store *lvs, spdk_lvs_op_complete cb_fn,
lvs_req->lvs = lvs; lvs_req->lvs = lvs;
SPDK_INFOLOG(SPDK_LOG_LVOL, "Deleting super blob\n"); SPDK_INFOLOG(SPDK_LOG_LVOL, "Deleting super blob\n");
spdk_bs_md_delete_blob(lvs->blobstore, lvs->super_blob_id, _lvs_destroy_super_cb, lvs_req); spdk_bs_delete_blob(lvs->blobstore, lvs->super_blob_id, _lvs_destroy_super_cb, lvs_req);
return 0; return 0;
} }
@ -833,7 +833,7 @@ _spdk_lvol_destroy_cb(void *cb_arg, int lvolerrno)
} }
SPDK_INFOLOG(SPDK_LOG_LVOL, "Blob closed on lvol %s\n", lvol->old_name); SPDK_INFOLOG(SPDK_LOG_LVOL, "Blob closed on lvol %s\n", lvol->old_name);
spdk_bs_md_delete_blob(bs, lvol->blob_id, _spdk_lvol_delete_blob_cb, req); spdk_bs_delete_blob(bs, lvol->blob_id, _spdk_lvol_delete_blob_cb, req);
} }
@ -921,7 +921,7 @@ _spdk_lvol_create_cb(void *cb_arg, spdk_blob_id blobid, int lvolerrno)
bs = req->lvol->lvol_store->blobstore; bs = req->lvol->lvol_store->blobstore;
spdk_bs_md_open_blob(bs, blobid, _spdk_lvol_create_open_cb, req); spdk_bs_open_blob(bs, blobid, _spdk_lvol_create_open_cb, req);
} }
int int
@ -986,7 +986,7 @@ spdk_lvol_create(struct spdk_lvol_store *lvs, const char *name, uint64_t sz,
strncpy(lvol->name, name, SPDK_LVS_NAME_MAX); strncpy(lvol->name, name, SPDK_LVS_NAME_MAX);
req->lvol = lvol; req->lvol = lvol;
spdk_bs_md_create_blob(lvs->blobstore, _spdk_lvol_create_cb, req); spdk_bs_create_blob(lvs->blobstore, _spdk_lvol_create_cb, req);
return 0; return 0;
} }
@ -1091,7 +1091,7 @@ spdk_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_
req->cb_arg = lvol_req; req->cb_arg = lvol_req;
req->lvol = lvol; req->lvol = lvol;
spdk_bs_md_delete_blob(bs, lvol->blob_id, _spdk_lvol_delete_blob_cb, req); spdk_bs_delete_blob(bs, lvol->blob_id, _spdk_lvol_delete_blob_cb, req);
} }
void void

View File

@ -185,8 +185,7 @@ blob_super(void)
CU_ASSERT(g_blobid == SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid == SPDK_BLOBID_INVALID);
/* Create a blob */ /* Create a blob */
spdk_bs_md_create_blob(bs, spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
@ -220,12 +219,12 @@ blob_open(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
bs = g_bs; bs = g_bs;
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -234,7 +233,7 @@ blob_open(void)
CU_ASSERT(blobid == blobid2); CU_ASSERT(blobid == blobid2);
/* Try to open file again. It should return success. */ /* Try to open file again. It should return success. */
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(blob == g_blob); CU_ASSERT(blob == g_blob);
@ -254,7 +253,7 @@ blob_open(void)
* Try to open file again. It should succeed. This tests the case * Try to open file again. It should succeed. This tests the case
* where the file is opened, closed, then re-opened again. * where the file is opened, closed, then re-opened again.
*/ */
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -282,16 +281,16 @@ blob_delete(void)
bs = g_bs; bs = g_bs;
/* Create a blob and then delete it. */ /* Create a blob and then delete it. */
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid > 0); CU_ASSERT(g_blobid > 0);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_delete_blob(bs, blobid, blob_op_complete, NULL); spdk_bs_delete_blob(bs, blobid, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
/* Try to open the blob */ /* Try to open the blob */
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == -ENOENT); CU_ASSERT(g_bserrno == -ENOENT);
spdk_bs_unload(g_bs, bs_op_complete, NULL); spdk_bs_unload(g_bs, bs_op_complete, NULL);
@ -317,13 +316,13 @@ blob_resize(void)
bs = g_bs; bs = g_bs;
free_clusters = spdk_bs_free_cluster_count(bs); free_clusters = spdk_bs_free_cluster_count(bs);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
CU_ASSERT(free_clusters == spdk_bs_free_cluster_count(bs)); CU_ASSERT(free_clusters == spdk_bs_free_cluster_count(bs));
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -360,7 +359,7 @@ blob_resize(void)
spdk_blob_close(&blob, blob_op_complete, NULL); spdk_blob_close(&blob, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_delete_blob(bs, blobid, blob_op_complete, NULL); spdk_bs_delete_blob(bs, blobid, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_unload(g_bs, bs_op_complete, NULL); spdk_bs_unload(g_bs, bs_op_complete, NULL);
@ -416,12 +415,12 @@ blob_write(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -488,12 +487,12 @@ blob_read(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -558,12 +557,12 @@ blob_rw_verify(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -616,12 +615,12 @@ blob_rw_verify_iov(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -718,12 +717,12 @@ blob_rw_verify_iov_nomem(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -783,12 +782,12 @@ blob_rw_iov_read_only(void)
channel = spdk_bs_alloc_io_channel(bs); channel = spdk_bs_alloc_io_channel(bs);
CU_ASSERT(channel != NULL); CU_ASSERT(channel != NULL);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -834,22 +833,22 @@ blob_iter(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
bs = g_bs; bs = g_bs;
spdk_bs_md_iter_first(bs, blob_op_with_handle_complete, NULL); spdk_bs_iter_first(bs, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
CU_ASSERT(g_bserrno == -ENOENT); CU_ASSERT(g_bserrno == -ENOENT);
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_iter_first(bs, blob_op_with_handle_complete, NULL); spdk_bs_iter_first(bs, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
blob = g_blob; blob = g_blob;
CU_ASSERT(spdk_blob_get_id(blob) == blobid); CU_ASSERT(spdk_blob_get_id(blob) == blobid);
spdk_bs_md_iter_next(bs, &blob, blob_op_with_handle_complete, NULL); spdk_bs_iter_next(bs, &blob, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
CU_ASSERT(g_bserrno == -ENOENT); CU_ASSERT(g_bserrno == -ENOENT);
@ -879,12 +878,12 @@ blob_xattr(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
bs = g_bs; bs = g_bs;
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -978,23 +977,23 @@ bs_load(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
/* Try to open a blobid that does not exist */ /* Try to open a blobid that does not exist */
spdk_bs_md_open_blob(g_bs, 0, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, 0, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == -ENOENT); CU_ASSERT(g_bserrno == -ENOENT);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
/* Create a blob */ /* Create a blob */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(g_bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
/* Try again to open valid blob but without the upper bit set */ /* Try again to open valid blob but without the upper bit set */
spdk_bs_md_open_blob(g_bs, blobid & 0xFFFFFFFF, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid & 0xFFFFFFFF, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == -ENOENT); CU_ASSERT(g_bserrno == -ENOENT);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
@ -1037,7 +1036,7 @@ bs_load(void)
super_block = (struct spdk_bs_super_block *)g_dev_buffer; super_block = (struct spdk_bs_super_block *)g_dev_buffer;
CU_ASSERT(super_block->clean == 0); CU_ASSERT(super_block->clean == 0);
spdk_bs_md_open_blob(g_bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1219,13 +1218,13 @@ bs_unload(void)
/* Create a blob and open it. */ /* Create a blob and open it. */
g_bserrno = -1; g_bserrno = -1;
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid > 0); CU_ASSERT(g_blobid > 0);
blobid = g_blobid; blobid = g_blobid;
g_bserrno = -1; g_bserrno = -1;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1367,13 +1366,13 @@ bs_usable_clusters(void)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
g_bserrno = -1; g_bserrno = -1;
g_blobid = SPDK_BLOBID_INVALID; g_blobid = SPDK_BLOBID_INVALID;
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
g_bserrno = -1; g_bserrno = -1;
g_blob = NULL; g_blob = NULL;
spdk_bs_md_open_blob(g_bs, g_blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, g_blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
@ -1437,8 +1436,7 @@ bs_resize_md(void)
for (i = 0; i < NUM_BLOBS; i++) { for (i = 0; i < NUM_BLOBS; i++) {
g_bserrno = -1; g_bserrno = -1;
g_blobid = SPDK_BLOBID_INVALID; g_blobid = SPDK_BLOBID_INVALID;
spdk_bs_md_create_blob(g_bs, spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobids[i] = g_blobid; blobids[i] = g_blobid;
@ -1462,7 +1460,7 @@ bs_resize_md(void)
for (i = 0; i < NUM_BLOBS; i++) { for (i = 0; i < NUM_BLOBS; i++) {
g_bserrno = -1; g_bserrno = -1;
g_blob = NULL; g_blob = NULL;
spdk_bs_md_open_blob(g_bs, blobids[i], blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobids[i], blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
g_bserrno = -1; g_bserrno = -1;
@ -1538,13 +1536,13 @@ blob_serialize(void)
/* Create and open two blobs */ /* Create and open two blobs */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid[i] = g_blobid; blobid[i] = g_blobid;
/* Open a blob */ /* Open a blob */
spdk_bs_md_open_blob(bs, blobid[i], blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid[i], blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob[i] = g_blob; blob[i] = g_blob;
@ -1598,7 +1596,7 @@ blob_serialize(void)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
blob[i] = NULL; blob[i] = NULL;
spdk_bs_md_open_blob(bs, blobid[i], blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid[i], blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob[i] = g_blob; blob[i] = g_blob;
@ -1632,12 +1630,12 @@ blob_crc(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
bs = g_bs; bs = g_bs;
spdk_bs_md_create_blob(bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid = g_blobid; blobid = g_blobid;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1651,12 +1649,12 @@ blob_crc(void)
page = (struct spdk_blob_md_page *)&g_dev_buffer[index]; page = (struct spdk_blob_md_page *)&g_dev_buffer[index];
page->crc = 0; page->crc = 0;
spdk_bs_md_open_blob(bs, blobid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(bs, blobid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == -EINVAL); CU_ASSERT(g_bserrno == -EINVAL);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
g_bserrno = 0; g_bserrno = 0;
spdk_bs_md_delete_blob(bs, blobid, blob_op_complete, NULL); spdk_bs_delete_blob(bs, blobid, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == -EINVAL); CU_ASSERT(g_bserrno == -EINVAL);
spdk_bs_unload(g_bs, bs_op_complete, NULL); spdk_bs_unload(g_bs, bs_op_complete, NULL);
@ -1734,12 +1732,12 @@ blob_dirty_shutdown(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
/* Create first blob */ /* Create first blob */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid1 = g_blobid; blobid1 = g_blobid;
spdk_bs_md_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1770,7 +1768,7 @@ blob_dirty_shutdown(void)
spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL); spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1804,7 +1802,7 @@ blob_dirty_shutdown(void)
spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL); spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
spdk_bs_md_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1817,12 +1815,12 @@ blob_dirty_shutdown(void)
g_blobid = SPDK_BLOBID_INVALID; g_blobid = SPDK_BLOBID_INVALID;
/* Create second blob */ /* Create second blob */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid2 = g_blobid; blobid2 = g_blobid;
spdk_bs_md_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1853,7 +1851,7 @@ blob_dirty_shutdown(void)
spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL); spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1869,7 +1867,7 @@ blob_dirty_shutdown(void)
spdk_blob_close(&blob, blob_op_complete, NULL); spdk_blob_close(&blob, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_delete_blob(g_bs, blobid2, blob_op_complete, NULL); spdk_bs_delete_blob(g_bs, blobid2, blob_op_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
/* Dirty shutdown */ /* Dirty shutdown */
@ -1880,11 +1878,11 @@ blob_dirty_shutdown(void)
spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL); spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno != 0); CU_ASSERT(g_bserrno != 0);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
spdk_bs_md_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid1, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
spdk_blob_close(&g_blob, blob_op_complete, NULL); spdk_blob_close(&g_blob, blob_op_complete, NULL);
@ -1901,18 +1899,18 @@ blob_dirty_shutdown(void)
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
/* Create second blob */ /* Create second blob */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid2 = g_blobid; blobid2 = g_blobid;
/* Create third blob */ /* Create third blob */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid3 = g_blobid; blobid3 = g_blobid;
spdk_bs_md_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1930,7 +1928,7 @@ blob_dirty_shutdown(void)
g_blob = NULL; g_blob = NULL;
g_blobid = SPDK_BLOBID_INVALID; g_blobid = SPDK_BLOBID_INVALID;
spdk_bs_md_open_blob(g_bs, blobid3, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid3, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -1964,11 +1962,11 @@ blob_dirty_shutdown(void)
spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL); spdk_bs_load(dev, &opts, bs_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
spdk_bs_md_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid2, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno != 0); CU_ASSERT(g_bserrno != 0);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
spdk_bs_md_open_blob(g_bs, blobid3, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid3, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob = g_blob; blob = g_blob;
@ -2000,32 +1998,32 @@ blob_flags(void)
SPDK_CU_ASSERT_FATAL(g_bs != NULL); SPDK_CU_ASSERT_FATAL(g_bs != NULL);
/* Create three blobs - one each for testing invalid, data_ro and md_ro flags. */ /* Create three blobs - one each for testing invalid, data_ro and md_ro flags. */
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid_invalid = g_blobid; blobid_invalid = g_blobid;
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid_data_ro = g_blobid; blobid_data_ro = g_blobid;
spdk_bs_md_create_blob(g_bs, blob_op_with_id_complete, NULL); spdk_bs_create_blob(g_bs, blob_op_with_id_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID); CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
blobid_md_ro = g_blobid; blobid_md_ro = g_blobid;
spdk_bs_md_open_blob(g_bs, blobid_invalid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_invalid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob_invalid = g_blob; blob_invalid = g_blob;
spdk_bs_md_open_blob(g_bs, blobid_data_ro, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_data_ro, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob_data_ro = g_blob; blob_data_ro = g_blob;
spdk_bs_md_open_blob(g_bs, blobid_md_ro, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_md_ro, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
CU_ASSERT(g_blob != NULL); CU_ASSERT(g_blob != NULL);
blob_md_ro = g_blob; blob_md_ro = g_blob;
@ -2076,13 +2074,13 @@ blob_flags(void)
g_blob = NULL; g_blob = NULL;
g_bserrno = 0; g_bserrno = 0;
spdk_bs_md_open_blob(g_bs, blobid_invalid, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_invalid, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno != 0); CU_ASSERT(g_bserrno != 0);
CU_ASSERT(g_blob == NULL); CU_ASSERT(g_blob == NULL);
g_blob = NULL; g_blob = NULL;
g_bserrno = -1; g_bserrno = -1;
spdk_bs_md_open_blob(g_bs, blobid_data_ro, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_data_ro, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob_data_ro = g_blob; blob_data_ro = g_blob;
@ -2092,7 +2090,7 @@ blob_flags(void)
g_blob = NULL; g_blob = NULL;
g_bserrno = -1; g_bserrno = -1;
spdk_bs_md_open_blob(g_bs, blobid_md_ro, blob_op_with_handle_complete, NULL); spdk_bs_open_blob(g_bs, blobid_md_ro, blob_op_with_handle_complete, NULL);
CU_ASSERT(g_bserrno == 0); CU_ASSERT(g_bserrno == 0);
SPDK_CU_ASSERT_FATAL(g_blob != NULL); SPDK_CU_ASSERT_FATAL(g_blob != NULL);
blob_md_ro = g_blob; blob_md_ro = g_blob;

View File

@ -88,8 +88,8 @@ struct lvol_ut_bs_dev {
}; };
void void
spdk_bs_md_iter_next(struct spdk_blob_store *bs, struct spdk_blob **b, spdk_bs_iter_next(struct spdk_blob_store *bs, struct spdk_blob **b,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob *next; struct spdk_blob *next;
int _errno = 0; int _errno = 0;
@ -105,8 +105,8 @@ spdk_bs_md_iter_next(struct spdk_blob_store *bs, struct spdk_blob **b,
} }
void void
spdk_bs_md_iter_first(struct spdk_blob_store *bs, spdk_bs_iter_first(struct spdk_blob_store *bs,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob *first; struct spdk_blob *first;
int _errno = 0; int _errno = 0;
@ -265,8 +265,8 @@ spdk_bs_destroy(struct spdk_blob_store *bs, spdk_bs_op_complete cb_fn,
} }
void void
spdk_bs_md_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, spdk_bs_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_complete cb_fn, void *cb_arg) spdk_blob_op_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob *blob; struct spdk_blob *blob;
@ -323,8 +323,8 @@ spdk_blob_sync_md(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *cb_
} }
void void
spdk_bs_md_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid, spdk_bs_open_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
spdk_blob_op_with_handle_complete cb_fn, void *cb_arg) spdk_blob_op_with_handle_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob *blob; struct spdk_blob *blob;
@ -346,8 +346,8 @@ spdk_bs_free_cluster_count(struct spdk_blob_store *bs)
} }
void void
spdk_bs_md_create_blob(struct spdk_blob_store *bs, spdk_bs_create_blob(struct spdk_blob_store *bs,
spdk_blob_op_with_id_complete cb_fn, void *cb_arg) spdk_blob_op_with_id_complete cb_fn, void *cb_arg)
{ {
struct spdk_blob *b; struct spdk_blob *b;