lib/blob: remove _spdk prefix from all functions.
Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: Idb33816e5b66266987845172c27c87667ac0a596 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2437 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
d145b9779f
commit
b5d68d5934
@ -133,7 +133,7 @@ bs_create_blob_bs_dev(struct spdk_blob *blob)
|
||||
}
|
||||
/* snapshot blob */
|
||||
b->bs_dev.blockcnt = blob->active.num_clusters *
|
||||
blob->bs->pages_per_cluster * _spdk_bs_io_unit_per_page(blob->bs);
|
||||
blob->bs->pages_per_cluster * bs_io_unit_per_page(blob->bs);
|
||||
b->bs_dev.blocklen = spdk_bs_get_io_unit_size(blob->bs);
|
||||
b->bs_dev.create_channel = NULL;
|
||||
b->bs_dev.destroy_channel = NULL;
|
||||
|
1720
lib/blob/blobstore.c
1720
lib/blob/blobstore.c
File diff suppressed because it is too large
Load Diff
@ -453,7 +453,7 @@ struct spdk_bs_dev *bs_create_blob_bs_dev(struct spdk_blob *blob);
|
||||
* for a particular blob.
|
||||
*/
|
||||
static inline uint64_t
|
||||
_spdk_bs_byte_to_lba(struct spdk_blob_store *bs, uint64_t length)
|
||||
bs_byte_to_lba(struct spdk_blob_store *bs, uint64_t length)
|
||||
{
|
||||
assert(length % bs->dev->blocklen == 0);
|
||||
|
||||
@ -461,7 +461,7 @@ _spdk_bs_byte_to_lba(struct spdk_blob_store *bs, uint64_t length)
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_dev_byte_to_lba(struct spdk_bs_dev *bs_dev, uint64_t length)
|
||||
bs_dev_byte_to_lba(struct spdk_bs_dev *bs_dev, uint64_t length)
|
||||
{
|
||||
assert(length % bs_dev->blocklen == 0);
|
||||
|
||||
@ -469,44 +469,44 @@ _spdk_bs_dev_byte_to_lba(struct spdk_bs_dev *bs_dev, uint64_t length)
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_page_to_lba(struct spdk_blob_store *bs, uint64_t page)
|
||||
bs_page_to_lba(struct spdk_blob_store *bs, uint64_t page)
|
||||
{
|
||||
return page * SPDK_BS_PAGE_SIZE / bs->dev->blocklen;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_md_page_to_lba(struct spdk_blob_store *bs, uint32_t page)
|
||||
bs_md_page_to_lba(struct spdk_blob_store *bs, uint32_t page)
|
||||
{
|
||||
assert(page < bs->md_len);
|
||||
return _spdk_bs_page_to_lba(bs, page + bs->md_start);
|
||||
return bs_page_to_lba(bs, page + bs->md_start);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_dev_page_to_lba(struct spdk_bs_dev *bs_dev, uint64_t page)
|
||||
bs_dev_page_to_lba(struct spdk_bs_dev *bs_dev, uint64_t page)
|
||||
{
|
||||
return page * SPDK_BS_PAGE_SIZE / bs_dev->blocklen;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_io_unit_per_page(struct spdk_blob_store *bs)
|
||||
bs_io_unit_per_page(struct spdk_blob_store *bs)
|
||||
{
|
||||
return SPDK_BS_PAGE_SIZE / bs->io_unit_size;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_io_unit_to_page(struct spdk_blob_store *bs, uint64_t io_unit)
|
||||
bs_io_unit_to_page(struct spdk_blob_store *bs, uint64_t io_unit)
|
||||
{
|
||||
return io_unit / _spdk_bs_io_unit_per_page(bs);
|
||||
return io_unit / bs_io_unit_per_page(bs);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_cluster_to_page(struct spdk_blob_store *bs, uint32_t cluster)
|
||||
bs_cluster_to_page(struct spdk_blob_store *bs, uint32_t cluster)
|
||||
{
|
||||
return (uint64_t)cluster * bs->pages_per_cluster;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
_spdk_bs_page_to_cluster(struct spdk_blob_store *bs, uint64_t page)
|
||||
bs_page_to_cluster(struct spdk_blob_store *bs, uint64_t page)
|
||||
{
|
||||
assert(page % bs->pages_per_cluster == 0);
|
||||
|
||||
@ -514,13 +514,13 @@ _spdk_bs_page_to_cluster(struct spdk_blob_store *bs, uint64_t page)
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_cluster_to_lba(struct spdk_blob_store *bs, uint32_t cluster)
|
||||
bs_cluster_to_lba(struct spdk_blob_store *bs, uint32_t cluster)
|
||||
{
|
||||
return (uint64_t)cluster * (bs->cluster_sz / bs->dev->blocklen);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
_spdk_bs_lba_to_cluster(struct spdk_blob_store *bs, uint64_t lba)
|
||||
bs_lba_to_cluster(struct spdk_blob_store *bs, uint64_t lba)
|
||||
{
|
||||
assert(lba % (bs->cluster_sz / bs->dev->blocklen) == 0);
|
||||
|
||||
@ -528,27 +528,27 @@ _spdk_bs_lba_to_cluster(struct spdk_blob_store *bs, uint64_t lba)
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_io_unit_to_back_dev_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_io_unit_to_back_dev_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
return io_unit * (blob->bs->io_unit_size / blob->back_bs_dev->blocklen);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_back_dev_lba_to_io_unit(struct spdk_blob *blob, uint64_t lba)
|
||||
bs_back_dev_lba_to_io_unit(struct spdk_blob *blob, uint64_t lba)
|
||||
{
|
||||
return lba * (blob->back_bs_dev->blocklen / blob->bs->io_unit_size);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_cluster_to_extent_table_id(uint64_t cluster_num)
|
||||
bs_cluster_to_extent_table_id(uint64_t cluster_num)
|
||||
{
|
||||
return cluster_num / SPDK_EXTENTS_PER_EP;
|
||||
}
|
||||
|
||||
static inline uint32_t *
|
||||
_spdk_bs_cluster_to_extent_page(struct spdk_blob *blob, uint64_t cluster_num)
|
||||
bs_cluster_to_extent_page(struct spdk_blob *blob, uint64_t cluster_num)
|
||||
{
|
||||
uint64_t extent_table_id = _spdk_bs_cluster_to_extent_table_id(cluster_num);
|
||||
uint64_t extent_table_id = bs_cluster_to_extent_table_id(cluster_num);
|
||||
|
||||
assert(blob->use_extent_table);
|
||||
assert(extent_table_id < blob->active.extent_pages_array_size);
|
||||
@ -559,7 +559,7 @@ _spdk_bs_cluster_to_extent_page(struct spdk_blob *blob, uint64_t cluster_num)
|
||||
/* End basic conversions */
|
||||
|
||||
static inline uint64_t
|
||||
_spdk_bs_blobid_to_page(spdk_blob_id id)
|
||||
bs_blobid_to_page(spdk_blob_id id)
|
||||
{
|
||||
return id & 0xFFFFFFFF;
|
||||
}
|
||||
@ -569,7 +569,7 @@ _spdk_bs_blobid_to_page(spdk_blob_id id)
|
||||
* code assumes blob id == page_idx.
|
||||
*/
|
||||
static inline spdk_blob_id
|
||||
_spdk_bs_page_to_blobid(uint64_t page_idx)
|
||||
bs_page_to_blobid(uint64_t page_idx)
|
||||
{
|
||||
if (page_idx > UINT32_MAX) {
|
||||
return SPDK_BLOBID_INVALID;
|
||||
@ -581,7 +581,7 @@ _spdk_bs_page_to_blobid(uint64_t page_idx)
|
||||
* start of that io unit.
|
||||
*/
|
||||
static inline uint64_t
|
||||
_spdk_bs_blob_io_unit_to_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_blob_io_unit_to_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
uint64_t lba;
|
||||
uint64_t pages_per_cluster;
|
||||
@ -590,11 +590,11 @@ _spdk_bs_blob_io_unit_to_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
uint64_t io_units_per_page;
|
||||
uint64_t page;
|
||||
|
||||
page = _spdk_bs_io_unit_to_page(blob->bs, io_unit);
|
||||
page = bs_io_unit_to_page(blob->bs, io_unit);
|
||||
|
||||
pages_per_cluster = blob->bs->pages_per_cluster;
|
||||
shift = blob->bs->pages_per_cluster_shift;
|
||||
io_units_per_page = _spdk_bs_io_unit_per_page(blob->bs);
|
||||
io_units_per_page = bs_io_unit_per_page(blob->bs);
|
||||
|
||||
assert(page < blob->active.num_clusters * pages_per_cluster);
|
||||
|
||||
@ -613,15 +613,15 @@ _spdk_bs_blob_io_unit_to_lba(struct spdk_blob *blob, uint64_t io_unit)
|
||||
* next cluster boundary.
|
||||
*/
|
||||
static inline uint32_t
|
||||
_spdk_bs_num_io_units_to_cluster_boundary(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_num_io_units_to_cluster_boundary(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
uint64_t io_units_per_cluster;
|
||||
uint8_t shift = blob->bs->pages_per_cluster_shift;
|
||||
|
||||
if (shift != 0) {
|
||||
io_units_per_cluster = _spdk_bs_io_unit_per_page(blob->bs) << shift;
|
||||
io_units_per_cluster = bs_io_unit_per_page(blob->bs) << shift;
|
||||
} else {
|
||||
io_units_per_cluster = _spdk_bs_io_unit_per_page(blob->bs) * blob->bs->pages_per_cluster;
|
||||
io_units_per_cluster = bs_io_unit_per_page(blob->bs) * blob->bs->pages_per_cluster;
|
||||
}
|
||||
|
||||
return io_units_per_cluster - (io_unit % io_units_per_cluster);
|
||||
@ -631,7 +631,7 @@ _spdk_bs_num_io_units_to_cluster_boundary(struct spdk_blob *blob, uint64_t io_un
|
||||
* next cluster boundary.
|
||||
*/
|
||||
static inline uint32_t
|
||||
_spdk_bs_num_pages_to_cluster_boundary(struct spdk_blob *blob, uint64_t page)
|
||||
bs_num_pages_to_cluster_boundary(struct spdk_blob *blob, uint64_t page)
|
||||
{
|
||||
uint64_t pages_per_cluster;
|
||||
|
||||
@ -642,26 +642,26 @@ _spdk_bs_num_pages_to_cluster_boundary(struct spdk_blob *blob, uint64_t page)
|
||||
|
||||
/* Given an io_unit offset into a blob, look up the number of pages into blob to beginning of current cluster */
|
||||
static inline uint32_t
|
||||
_spdk_bs_io_unit_to_cluster_start(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_io_unit_to_cluster_start(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
uint64_t pages_per_cluster;
|
||||
uint64_t page;
|
||||
|
||||
pages_per_cluster = blob->bs->pages_per_cluster;
|
||||
page = _spdk_bs_io_unit_to_page(blob->bs, io_unit);
|
||||
page = bs_io_unit_to_page(blob->bs, io_unit);
|
||||
|
||||
return page - (page % pages_per_cluster);
|
||||
}
|
||||
|
||||
/* Given an io_unit offset into a blob, look up the number of pages into blob to beginning of current cluster */
|
||||
static inline uint32_t
|
||||
_spdk_bs_io_unit_to_cluster_number(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_io_unit_to_cluster_number(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
uint64_t pages_per_cluster = blob->bs->pages_per_cluster;
|
||||
uint8_t shift = blob->bs->pages_per_cluster_shift;
|
||||
uint32_t page_offset;
|
||||
|
||||
page_offset = io_unit / _spdk_bs_io_unit_per_page(blob->bs);
|
||||
page_offset = io_unit / bs_io_unit_per_page(blob->bs);
|
||||
if (shift != 0) {
|
||||
return page_offset >> shift;
|
||||
} else {
|
||||
@ -671,7 +671,7 @@ _spdk_bs_io_unit_to_cluster_number(struct spdk_blob *blob, uint64_t io_unit)
|
||||
|
||||
/* Given an io unit offset into a blob, look up if it is from allocated cluster. */
|
||||
static inline bool
|
||||
_spdk_bs_io_unit_is_allocated(struct spdk_blob *blob, uint64_t io_unit)
|
||||
bs_io_unit_is_allocated(struct spdk_blob *blob, uint64_t io_unit)
|
||||
{
|
||||
uint64_t lba;
|
||||
uint64_t page;
|
||||
@ -680,7 +680,7 @@ _spdk_bs_io_unit_is_allocated(struct spdk_blob *blob, uint64_t io_unit)
|
||||
|
||||
shift = blob->bs->pages_per_cluster_shift;
|
||||
pages_per_cluster = blob->bs->pages_per_cluster;
|
||||
page = _spdk_bs_io_unit_to_page(blob->bs, io_unit);
|
||||
page = bs_io_unit_to_page(blob->bs, io_unit);
|
||||
|
||||
assert(page < blob->active.num_clusters * pages_per_cluster);
|
||||
|
||||
|
@ -197,7 +197,7 @@ ut_bs_dirty_load(struct spdk_blob_store **bs, struct spdk_bs_opts *opts)
|
||||
struct spdk_bs_dev *dev;
|
||||
|
||||
/* Dirty shutdown */
|
||||
_spdk_bs_free(*bs);
|
||||
bs_free(*bs);
|
||||
|
||||
dev = init_dev();
|
||||
/* Load an existing blob store */
|
||||
@ -461,13 +461,13 @@ blob_create_internal(void)
|
||||
/* Create blob with custom xattrs */
|
||||
|
||||
ut_spdk_blob_opts_init(&opts);
|
||||
_spdk_blob_xattrs_init(&internal_xattrs);
|
||||
blob_xattrs_init(&internal_xattrs);
|
||||
internal_xattrs.count = 3;
|
||||
internal_xattrs.names = g_xattr_names;
|
||||
internal_xattrs.get_value = _get_xattr_value;
|
||||
internal_xattrs.ctx = &g_ctx;
|
||||
|
||||
_spdk_bs_create_blob(bs, &opts, &internal_xattrs, blob_op_with_id_complete, NULL);
|
||||
bs_create_blob(bs, &opts, &internal_xattrs, blob_op_with_id_complete, NULL);
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
|
||||
@ -479,19 +479,19 @@ blob_create_internal(void)
|
||||
SPDK_CU_ASSERT_FATAL(g_blob != NULL);
|
||||
blob = g_blob;
|
||||
|
||||
rc = _spdk_blob_get_xattr_value(blob, g_xattr_names[0], &value, &value_len, true);
|
||||
rc = blob_get_xattr_value(blob, g_xattr_names[0], &value, &value_len, true);
|
||||
CU_ASSERT(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(value != NULL);
|
||||
CU_ASSERT(value_len == strlen(g_xattr_values[0]));
|
||||
CU_ASSERT_NSTRING_EQUAL_FATAL(value, g_xattr_values[0], value_len);
|
||||
|
||||
rc = _spdk_blob_get_xattr_value(blob, g_xattr_names[1], &value, &value_len, true);
|
||||
rc = blob_get_xattr_value(blob, g_xattr_names[1], &value, &value_len, true);
|
||||
CU_ASSERT(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(value != NULL);
|
||||
CU_ASSERT(value_len == strlen(g_xattr_values[1]));
|
||||
CU_ASSERT_NSTRING_EQUAL((char *)value, g_xattr_values[1], value_len);
|
||||
|
||||
rc = _spdk_blob_get_xattr_value(blob, g_xattr_names[2], &value, &value_len, true);
|
||||
rc = blob_get_xattr_value(blob, g_xattr_names[2], &value, &value_len, true);
|
||||
CU_ASSERT(rc == 0);
|
||||
SPDK_CU_ASSERT_FATAL(value != NULL);
|
||||
CU_ASSERT(value_len == strlen(g_xattr_values[2]));
|
||||
@ -512,7 +512,7 @@ blob_create_internal(void)
|
||||
|
||||
/* Create blob with NULL internal options */
|
||||
|
||||
_spdk_bs_create_blob(bs, NULL, NULL, blob_op_with_id_complete, NULL);
|
||||
bs_create_blob(bs, NULL, NULL, blob_op_with_id_complete, NULL);
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
CU_ASSERT(g_blobid != SPDK_BLOBID_INVALID);
|
||||
@ -1037,7 +1037,7 @@ blob_delete(void)
|
||||
}
|
||||
|
||||
static void
|
||||
blob_resize(void)
|
||||
blob_resize_test(void)
|
||||
{
|
||||
struct spdk_blob_store *bs = g_bs;
|
||||
struct spdk_blob *blob;
|
||||
@ -2009,15 +2009,15 @@ blob_xattr(void)
|
||||
|
||||
/* Set internal xattr */
|
||||
length = 7898;
|
||||
rc = _spdk_blob_set_xattr(blob, "internal", &length, sizeof(length), true);
|
||||
rc = blob_set_xattr(blob, "internal", &length, sizeof(length), true);
|
||||
CU_ASSERT(rc == 0);
|
||||
rc = _spdk_blob_get_xattr_value(blob, "internal", &value, &value_len, true);
|
||||
rc = blob_get_xattr_value(blob, "internal", &value, &value_len, true);
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(*(uint64_t *)value == length);
|
||||
/* try to get public xattr with same name */
|
||||
rc = spdk_blob_get_xattr_value(blob, "internal", &value, &value_len);
|
||||
CU_ASSERT(rc != 0);
|
||||
rc = _spdk_blob_get_xattr_value(blob, "internal", &value, &value_len, false);
|
||||
rc = blob_get_xattr_value(blob, "internal", &value, &value_len, false);
|
||||
CU_ASSERT(rc != 0);
|
||||
/* Check if SPDK_BLOB_INTERNAL_XATTR is set */
|
||||
CU_ASSERT((blob->invalid_flags & SPDK_BLOB_INTERNAL_XATTR) ==
|
||||
@ -2035,7 +2035,7 @@ blob_xattr(void)
|
||||
SPDK_CU_ASSERT_FATAL(g_blob != NULL);
|
||||
blob = g_blob;
|
||||
|
||||
rc = _spdk_blob_get_xattr_value(blob, "internal", &value, &value_len, true);
|
||||
rc = blob_get_xattr_value(blob, "internal", &value, &value_len, true);
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(*(uint64_t *)value == length);
|
||||
|
||||
@ -2043,7 +2043,7 @@ blob_xattr(void)
|
||||
rc = spdk_blob_get_xattr_value(blob, "internal", &value, &value_len);
|
||||
CU_ASSERT(rc != 0);
|
||||
|
||||
rc = _spdk_blob_remove_xattr(blob, "internal", true);
|
||||
rc = blob_remove_xattr(blob, "internal", true);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
CU_ASSERT((blob->invalid_flags & SPDK_BLOB_INTERNAL_XATTR) == 0);
|
||||
@ -2225,7 +2225,7 @@ bs_load(void)
|
||||
|
||||
dev = init_dev();
|
||||
super_block->size = 0;
|
||||
super_block->crc = _spdk_blob_md_page_calc_crc(super_block);
|
||||
super_block->crc = blob_md_page_calc_crc(super_block);
|
||||
|
||||
spdk_bs_opts_init(&opts);
|
||||
snprintf(opts.bstype.bstype, sizeof(opts.bstype.bstype), "TESTTYPE");
|
||||
@ -2287,7 +2287,7 @@ bs_load_pending_removal(void)
|
||||
|
||||
/* Set SNAPSHOT_PENDING_REMOVAL xattr */
|
||||
snapshot->md_ro = false;
|
||||
rc = _spdk_blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
|
||||
rc = blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
|
||||
CU_ASSERT(rc == 0);
|
||||
snapshot->md_ro = true;
|
||||
|
||||
@ -2315,7 +2315,7 @@ bs_load_pending_removal(void)
|
||||
|
||||
/* Set SNAPSHOT_PENDING_REMOVAL xattr again */
|
||||
snapshot->md_ro = false;
|
||||
rc = _spdk_blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
|
||||
rc = blob_set_xattr(snapshot, SNAPSHOT_PENDING_REMOVAL, &blobid, sizeof(spdk_blob_id), true);
|
||||
CU_ASSERT(rc == 0);
|
||||
snapshot->md_ro = true;
|
||||
|
||||
@ -2326,7 +2326,7 @@ bs_load_pending_removal(void)
|
||||
blob = g_blob;
|
||||
|
||||
/* Remove parent_id from blob by removing BLOB_SNAPSHOT xattr */
|
||||
_spdk_blob_remove_xattr(blob, BLOB_SNAPSHOT, true);
|
||||
blob_remove_xattr(blob, BLOB_SNAPSHOT, true);
|
||||
|
||||
spdk_blob_sync_md(blob, blob_op_complete, NULL);
|
||||
poll_threads();
|
||||
@ -2545,7 +2545,7 @@ bs_super_block(void)
|
||||
super_block_v1.md_start = 0x03;
|
||||
super_block_v1.md_len = 0x40;
|
||||
memset(super_block_v1.reserved, 0, 4036);
|
||||
super_block_v1.crc = _spdk_blob_md_page_calc_crc(&super_block_v1);
|
||||
super_block_v1.crc = blob_md_page_calc_crc(&super_block_v1);
|
||||
memcpy(g_dev_buffer, &super_block_v1, sizeof(struct spdk_bs_super_block_ver1));
|
||||
|
||||
memset(opts.bstype.bstype, 0, sizeof(opts.bstype.bstype));
|
||||
@ -2811,7 +2811,7 @@ bs_destroy(void)
|
||||
* a blob to disk
|
||||
*/
|
||||
static void
|
||||
blob_serialize(void)
|
||||
blob_serialize_test(void)
|
||||
{
|
||||
struct spdk_bs_dev *dev;
|
||||
struct spdk_bs_opts opts;
|
||||
@ -2913,7 +2913,7 @@ blob_crc(void)
|
||||
poll_threads();
|
||||
CU_ASSERT(g_bserrno == 0);
|
||||
|
||||
page_num = _spdk_bs_blobid_to_page(blobid);
|
||||
page_num = bs_blobid_to_page(blobid);
|
||||
index = DEV_BUFFER_BLOCKLEN * (bs->md_start + page_num);
|
||||
page = (struct spdk_blob_md_page *)&g_dev_buffer[index];
|
||||
page->crc = 0;
|
||||
@ -3213,12 +3213,12 @@ blob_dirty_shutdown(void)
|
||||
g_blobid = SPDK_BLOBID_INVALID;
|
||||
|
||||
/* Mark second blob as invalid */
|
||||
page_num = _spdk_bs_blobid_to_page(blobid2);
|
||||
page_num = bs_blobid_to_page(blobid2);
|
||||
|
||||
index = DEV_BUFFER_BLOCKLEN * (bs->md_start + page_num);
|
||||
page = (struct spdk_blob_md_page *)&g_dev_buffer[index];
|
||||
page->sequence_num = 1;
|
||||
page->crc = _spdk_blob_md_page_calc_crc(page);
|
||||
page->crc = blob_md_page_calc_crc(page);
|
||||
|
||||
free_clusters = spdk_bs_free_cluster_count(bs);
|
||||
|
||||
@ -3385,7 +3385,7 @@ bs_version(void)
|
||||
super->used_blobid_mask_len * SPDK_BS_PAGE_SIZE);
|
||||
super->used_blobid_mask_start = 0;
|
||||
super->used_blobid_mask_len = 0;
|
||||
super->crc = _spdk_blob_md_page_calc_crc(super);
|
||||
super->crc = blob_md_page_calc_crc(super);
|
||||
|
||||
/* Load an existing blob store */
|
||||
dev = init_dev();
|
||||
@ -3439,7 +3439,7 @@ bs_version(void)
|
||||
}
|
||||
|
||||
static void
|
||||
blob_set_xattrs(void)
|
||||
blob_set_xattrs_test(void)
|
||||
{
|
||||
struct spdk_blob_store *bs = g_bs;
|
||||
struct spdk_blob *blob;
|
||||
@ -3612,7 +3612,7 @@ blob_thin_prov_alloc(void)
|
||||
}
|
||||
|
||||
static void
|
||||
blob_insert_cluster_msg(void)
|
||||
blob_insert_cluster_msg_test(void)
|
||||
{
|
||||
struct spdk_blob_store *bs = g_bs;
|
||||
struct spdk_blob *blob;
|
||||
@ -3641,11 +3641,11 @@ blob_insert_cluster_msg(void)
|
||||
/* Specify cluster_num to allocate and new_cluster will be returned to insert on md_thread.
|
||||
* This is to simulate behaviour when cluster is allocated after blob creation.
|
||||
* Such as _spdk_bs_allocate_and_copy_cluster(). */
|
||||
_spdk_bs_allocate_cluster(blob, cluster_num, &new_cluster, &extent_page, false);
|
||||
bs_allocate_cluster(blob, cluster_num, &new_cluster, &extent_page, false);
|
||||
CU_ASSERT(blob->active.clusters[cluster_num] == 0);
|
||||
|
||||
_spdk_blob_insert_cluster_on_md_thread(blob, cluster_num, new_cluster, extent_page,
|
||||
blob_op_complete, NULL);
|
||||
blob_insert_cluster_on_md_thread(blob, cluster_num, new_cluster, extent_page,
|
||||
blob_op_complete, NULL);
|
||||
poll_threads();
|
||||
|
||||
CU_ASSERT(blob->active.clusters[cluster_num] != 0);
|
||||
@ -3795,7 +3795,7 @@ blob_thin_prov_rle(void)
|
||||
CU_ASSERT(channel != NULL);
|
||||
|
||||
/* Target specifically second cluster in a blob as first allocation */
|
||||
io_unit = _spdk_bs_cluster_to_page(bs, 1) * _spdk_bs_io_unit_per_page(bs);
|
||||
io_unit = bs_cluster_to_page(bs, 1) * bs_io_unit_per_page(bs);
|
||||
|
||||
/* Payload should be all zeros from unallocated clusters */
|
||||
memset(payload_read, 0xFF, sizeof(payload_read));
|
||||
@ -3959,7 +3959,7 @@ test_iter(void *arg, struct spdk_blob *blob, int bserrno)
|
||||
}
|
||||
|
||||
static void
|
||||
bs_load_iter(void)
|
||||
bs_load_iter_test(void)
|
||||
{
|
||||
struct spdk_blob_store *bs;
|
||||
struct spdk_bs_dev *dev;
|
||||
@ -4016,7 +4016,7 @@ bs_load_iter(void)
|
||||
bs = g_bs;
|
||||
|
||||
/* Dirty shutdown */
|
||||
_spdk_bs_free(bs);
|
||||
bs_free(bs);
|
||||
|
||||
dev = init_dev();
|
||||
spdk_bs_opts_init(&opts);
|
||||
@ -5279,7 +5279,7 @@ blobstore_clean_power_failure(void)
|
||||
blob->state = SPDK_BLOB_STATE_DIRTY;
|
||||
bs->clean = 1;
|
||||
super->clean = 1;
|
||||
super->crc = _spdk_blob_md_page_calc_crc(super);
|
||||
super->crc = blob_md_page_calc_crc(super);
|
||||
|
||||
g_bserrno = -1;
|
||||
dev_set_power_failure_thresholds(thresholds);
|
||||
@ -5297,7 +5297,7 @@ blobstore_clean_power_failure(void)
|
||||
|
||||
/* Depending on the point of failure, super block was either updated or not. */
|
||||
super_copy.clean = super->clean;
|
||||
super_copy.crc = _spdk_blob_md_page_calc_crc(&super_copy);
|
||||
super_copy.crc = blob_md_page_calc_crc(&super_copy);
|
||||
/* Compare that the values in super block remained unchanged. */
|
||||
SPDK_CU_ASSERT_FATAL(!memcmp(&super_copy, super, sizeof(struct spdk_bs_super_block)));
|
||||
|
||||
@ -6258,7 +6258,7 @@ blob_io_unit_compatiblity(void)
|
||||
* Check if loaded io unit size equals SPDK_BS_PAGE_SIZE */
|
||||
super = (struct spdk_bs_super_block *)&g_dev_buffer[0];
|
||||
super->io_unit_size = 0;
|
||||
super->crc = _spdk_blob_md_page_calc_crc(super);
|
||||
super->crc = blob_md_page_calc_crc(super);
|
||||
|
||||
dev = init_dev();
|
||||
dev->blocklen = 512;
|
||||
@ -6401,7 +6401,7 @@ blob_simultaneous_operations(void)
|
||||
}
|
||||
|
||||
static void
|
||||
blob_persist(void)
|
||||
blob_persist_test(void)
|
||||
{
|
||||
struct spdk_blob_store *bs = g_bs;
|
||||
struct spdk_blob_opts opts;
|
||||
@ -6619,7 +6619,7 @@ int main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite_bs, blob_clone);
|
||||
CU_ADD_TEST(suite_bs, blob_inflate);
|
||||
CU_ADD_TEST(suite_bs, blob_delete);
|
||||
CU_ADD_TEST(suite_bs, blob_resize);
|
||||
CU_ADD_TEST(suite_bs, blob_resize_test);
|
||||
CU_ADD_TEST(suite, blob_read_only);
|
||||
CU_ADD_TEST(suite_bs, channel_ops);
|
||||
CU_ADD_TEST(suite_bs, blob_super);
|
||||
@ -6642,19 +6642,19 @@ int main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, bs_destroy);
|
||||
CU_ADD_TEST(suite, bs_type);
|
||||
CU_ADD_TEST(suite, bs_super_block);
|
||||
CU_ADD_TEST(suite, blob_serialize);
|
||||
CU_ADD_TEST(suite, blob_serialize_test);
|
||||
CU_ADD_TEST(suite_bs, blob_crc);
|
||||
CU_ADD_TEST(suite, super_block_crc);
|
||||
CU_ADD_TEST(suite_blob, blob_dirty_shutdown);
|
||||
CU_ADD_TEST(suite_bs, blob_flags);
|
||||
CU_ADD_TEST(suite_bs, bs_version);
|
||||
CU_ADD_TEST(suite_bs, blob_set_xattrs);
|
||||
CU_ADD_TEST(suite_bs, blob_set_xattrs_test);
|
||||
CU_ADD_TEST(suite_bs, blob_thin_prov_alloc);
|
||||
CU_ADD_TEST(suite_bs, blob_insert_cluster_msg);
|
||||
CU_ADD_TEST(suite_bs, blob_insert_cluster_msg_test);
|
||||
CU_ADD_TEST(suite_bs, blob_thin_prov_rw);
|
||||
CU_ADD_TEST(suite_bs, blob_thin_prov_rle);
|
||||
CU_ADD_TEST(suite_bs, blob_thin_prov_rw_iov);
|
||||
CU_ADD_TEST(suite, bs_load_iter);
|
||||
CU_ADD_TEST(suite, bs_load_iter_test);
|
||||
CU_ADD_TEST(suite_bs, blob_snapshot_rw);
|
||||
CU_ADD_TEST(suite_bs, blob_snapshot_rw_iov);
|
||||
CU_ADD_TEST(suite, blob_relations);
|
||||
@ -6669,7 +6669,7 @@ int main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, blob_io_unit);
|
||||
CU_ADD_TEST(suite, blob_io_unit_compatiblity);
|
||||
CU_ADD_TEST(suite_bs, blob_simultaneous_operations);
|
||||
CU_ADD_TEST(suite_bs, blob_persist);
|
||||
CU_ADD_TEST(suite_bs, blob_persist_test);
|
||||
|
||||
allocate_threads(2);
|
||||
set_thread(0);
|
||||
|
Loading…
Reference in New Issue
Block a user