ut/bdev/raid: try to break lines after 100 characters
Some lines in this file are long and should be broken as bdev/raid/raid_rpc.c was done recently. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I98a7f965b7230f32ab6a2d33a0f204591fa92ac1 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464484 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
953975fe87
commit
20bbd038aa
@ -143,7 +143,8 @@ set_test_opts(void)
|
||||
g_max_io_size = 1024;
|
||||
|
||||
printf("Test Options\n");
|
||||
printf("blocklen = %u, strip_size = %u, max_io_size = %u, g_max_base_drives = %u, g_max_raids = %u\n",
|
||||
printf("blocklen = %u, strip_size = %u, max_io_size = %u, g_max_base_drives = %u, "
|
||||
"g_max_raids = %u\n",
|
||||
g_block_len, g_strip_size, g_max_io_size, g_max_base_drives, g_max_raids);
|
||||
}
|
||||
|
||||
@ -530,7 +531,8 @@ spdk_bdev_module_claim_bdev(struct spdk_bdev *bdev, struct spdk_bdev_desc *desc,
|
||||
|
||||
int
|
||||
spdk_json_decode_object(const struct spdk_json_val *values,
|
||||
const struct spdk_json_object_decoder *decoders, size_t num_decoders, void *out)
|
||||
const struct spdk_json_object_decoder *decoders, size_t num_decoders,
|
||||
void *out)
|
||||
{
|
||||
struct rpc_construct_raid_bdev *req, *_out;
|
||||
size_t i;
|
||||
@ -719,7 +721,8 @@ verify_io(struct spdk_bdev_io *bdev_io, uint8_t num_base_drives,
|
||||
|
||||
static void
|
||||
verify_io_without_payload(struct spdk_bdev_io *bdev_io, uint8_t num_base_drives,
|
||||
struct raid_bdev_io_channel *ch_ctx, struct raid_bdev *raid_bdev, uint32_t io_status)
|
||||
struct raid_bdev_io_channel *ch_ctx, struct raid_bdev *raid_bdev,
|
||||
uint32_t io_status)
|
||||
{
|
||||
uint32_t strip_shift = spdk_u32log2(g_strip_size);
|
||||
uint64_t start_offset_in_strip = bdev_io->u.bdev.offset_blocks % g_strip_size;
|
||||
@ -780,7 +783,8 @@ verify_io_without_payload(struct spdk_bdev_io *bdev_io, uint8_t num_base_drives,
|
||||
}
|
||||
|
||||
/* end_offset_in_disk aligned in strip check:
|
||||
* Base io on disk at which end_strip is located, has a same end_offset_in_strip with the whole raid io.
|
||||
* Base io on disk at which end_strip is located, has a same end_offset_in_strip
|
||||
* with the whole raid io.
|
||||
* Other base io should have aligned end_offset_in_strip.
|
||||
*/
|
||||
end_offset_in_disk = output->offset_blocks + output->num_blocks - 1;
|
||||
@ -791,10 +795,12 @@ verify_io_without_payload(struct spdk_bdev_io *bdev_io, uint8_t num_base_drives,
|
||||
}
|
||||
|
||||
/* start_offset_in_disk compared with start_disk.
|
||||
* 1. For disk_idx which is larger than start_strip_disk_idx: Its start_offset_in_disk mustn't be
|
||||
* larger than the start offset of start_offset_in_disk; And the gap must be less than strip size.
|
||||
* 2. For disk_idx which is less than start_strip_disk_idx, Its start_offset_in_disk must be
|
||||
* larger than the start offset of start_offset_in_disk; And the gap mustn't be less than strip size.
|
||||
* 1. For disk_idx which is larger than start_strip_disk_idx: Its start_offset_in_disk
|
||||
* mustn't be larger than the start offset of start_offset_in_disk; And the gap
|
||||
* must be less than strip size.
|
||||
* 2. For disk_idx which is less than start_strip_disk_idx, Its start_offset_in_disk
|
||||
* must be larger than the start offset of start_offset_in_disk; And the gap mustn't
|
||||
* be less than strip size.
|
||||
*/
|
||||
if (disk_idx > start_strip_disk_idx) {
|
||||
CU_ASSERT(start_offset_in_disk <= offset_in_start_disk);
|
||||
@ -887,7 +893,8 @@ verify_raid_config(struct rpc_construct_raid_bdev *r, bool presence)
|
||||
CU_ASSERT(raid_cfg->raid_level == r->raid_level);
|
||||
if (raid_cfg->base_bdev != NULL) {
|
||||
for (i = 0; i < raid_cfg->num_base_bdevs; i++) {
|
||||
val = strcmp(raid_cfg->base_bdev[i].name, r->base_bdevs.base_bdevs[i]);
|
||||
val = strcmp(raid_cfg->base_bdev[i].name,
|
||||
r->base_bdevs.base_bdevs[i]);
|
||||
CU_ASSERT(val == 0);
|
||||
}
|
||||
}
|
||||
@ -921,7 +928,8 @@ verify_raid_bdev(struct rpc_construct_raid_bdev *r, bool presence, uint32_t raid
|
||||
CU_ASSERT(pbdev->config->raid_bdev == pbdev);
|
||||
CU_ASSERT(pbdev->base_bdev_info != NULL);
|
||||
CU_ASSERT(pbdev->strip_size == ((r->strip_size_kb * 1024) / g_block_len));
|
||||
CU_ASSERT(pbdev->strip_size_shift == spdk_u32log2(((r->strip_size_kb * 1024) / g_block_len)));
|
||||
CU_ASSERT(pbdev->strip_size_shift == spdk_u32log2(((r->strip_size_kb * 1024) /
|
||||
g_block_len)));
|
||||
CU_ASSERT(pbdev->blocklen_shift == spdk_u32log2(g_block_len));
|
||||
CU_ASSERT(pbdev->state == raid_state);
|
||||
CU_ASSERT(pbdev->num_base_bdevs == r->base_bdevs.num_base_bdevs);
|
||||
@ -941,8 +949,9 @@ verify_raid_bdev(struct rpc_construct_raid_bdev *r, bool presence, uint32_t raid
|
||||
min_blockcnt = bdev->blockcnt;
|
||||
}
|
||||
}
|
||||
CU_ASSERT((((min_blockcnt / (r->strip_size_kb * 1024 / g_block_len)) * (r->strip_size_kb * 1024 /
|
||||
g_block_len)) * r->base_bdevs.num_base_bdevs) == pbdev->bdev.blockcnt);
|
||||
CU_ASSERT((((min_blockcnt / (r->strip_size_kb * 1024 / g_block_len)) *
|
||||
(r->strip_size_kb * 1024 / g_block_len)) *
|
||||
r->base_bdevs.num_base_bdevs) == pbdev->bdev.blockcnt);
|
||||
CU_ASSERT(strcmp(pbdev->bdev.product_name, "Raid Volume") == 0);
|
||||
CU_ASSERT(pbdev->bdev.write_cache == 0);
|
||||
CU_ASSERT(pbdev->bdev.blocklen == g_block_len);
|
||||
@ -1044,7 +1053,8 @@ verify_get_raids(struct rpc_construct_raid_bdev *construct_req,
|
||||
for (i = 0; i < g_max_raids; i++) {
|
||||
found = false;
|
||||
for (j = 0; j < g_max_raids; j++) {
|
||||
if (construct_req[i].name && strcmp(construct_req[i].name, g_get_raids_output[i]) == 0) {
|
||||
if (construct_req[i].name &&
|
||||
strcmp(construct_req[i].name, g_get_raids_output[i]) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@ -1599,8 +1609,9 @@ raid_bdev_io_generate(void)
|
||||
{
|
||||
uint64_t n_strips;
|
||||
uint64_t n_strips_span = g_max_base_drives;
|
||||
uint64_t n_strips_times[5] = {g_max_base_drives + 1, g_max_base_drives * 2 - 1, g_max_base_drives * 2,
|
||||
g_max_base_drives * 3, g_max_base_drives * 4
|
||||
uint64_t n_strips_times[5] = {g_max_base_drives + 1, g_max_base_drives * 2 - 1,
|
||||
g_max_base_drives * 2, g_max_base_drives * 3,
|
||||
g_max_base_drives * 4
|
||||
};
|
||||
uint32_t i;
|
||||
|
||||
@ -2297,8 +2308,10 @@ int main(int argc, char **argv)
|
||||
if (
|
||||
CU_add_test(suite, "test_construct_raid", test_construct_raid) == NULL ||
|
||||
CU_add_test(suite, "test_destroy_raid", test_destroy_raid) == NULL ||
|
||||
CU_add_test(suite, "test_construct_raid_invalid_args", test_construct_raid_invalid_args) == NULL ||
|
||||
CU_add_test(suite, "test_destroy_raid_invalid_args", test_destroy_raid_invalid_args) == NULL ||
|
||||
CU_add_test(suite, "test_construct_raid_invalid_args",
|
||||
test_construct_raid_invalid_args) == NULL ||
|
||||
CU_add_test(suite, "test_destroy_raid_invalid_args",
|
||||
test_destroy_raid_invalid_args) == NULL ||
|
||||
CU_add_test(suite, "test_io_channel", test_io_channel) == NULL ||
|
||||
CU_add_test(suite, "test_reset_io", test_reset_io) == NULL ||
|
||||
CU_add_test(suite, "test_write_io", test_write_io) == NULL ||
|
||||
|
Loading…
Reference in New Issue
Block a user