Lines Matching refs:bdev

32  * raid_bdev_io_channel is the context of spdk_io_channel for raid bdev device. It
33 * contains the relationship of raid bdev io channel with base bdev io channels.
174 static void raid_bdev_examine(struct spdk_bdev *bdev);
205 /* In the future we may have other types of processes which don't use a target bdev,
248 * raid_bdev_create_cb function is a cb function for raid bdev which creates the
249 * hierarchy from raid bdev to base bdev io channels. It will be called per core
251 * io_device - pointer to raid bdev io device represented by raid_bdev
252 * ctx_buf - pointer to context buffer for raid bdev io channel
279 * split logic to send the respective child bdev ios to respective base
280 * bdev io channel.
291 SPDK_ERRLOG("Unable to create io channel for base bdev\n");
330 * raid_bdev_destroy_cb function is a cb function for raid bdev which deletes the
331 * hierarchy from raid bdev to base bdev io channels. It will be called per core
333 * io_device - pointer to raid bdev io device represented by raid_bdev
334 * ctx_buf - pointer to context buffer for raid bdev io channel
355 /* Free base bdev channels */
381 raid_bdev, raid_bdev->bdev.name, raid_bdev_state_to_str(raid_bdev->state));
398 free(raid_bdev->bdev.name);
423 * free resource of base bdev for raid bdev
425 * base_info - raid base bdev info
469 SPDK_DEBUGLOG(bdev_raid, "raid bdev base bdevs is 0, going to free all in destruct\n");
471 spdk_bdev_destruct_done(&raid_bdev->bdev, 0);
474 spdk_bdev_destruct_done(&raid_bdev->bdev, 0);
498 * Close all base bdev descriptors for which call has come from below
529 struct spdk_bdev *bdev, uint32_t remapped_offset)
537 .iov_len = num_blocks * bdev->md_len,
545 dif_opts.dif_pi_format = bdev->dif_pi_format;
547 bdev->blocklen, bdev->md_len, bdev->md_interleave,
548 bdev->dif_is_head_of_md, bdev->dif_type,
569 uint64_t num_blocks, struct spdk_bdev *bdev, uint32_t offset_blocks)
577 .iov_len = num_blocks * bdev->md_len,
585 dif_opts.dif_pi_format = bdev->dif_pi_format;
587 bdev->blocklen, bdev->md_len, bdev->md_interleave,
588 bdev->dif_is_head_of_md, bdev->dif_type,
622 raid_io->offset_blocks = bdev_io->u.bdev.offset_blocks;
623 raid_io->md_buf = bdev_io->u.bdev.md_buf;
627 raid_io->iovcnt = raid_io->iovs - bdev_io->u.bdev.iovs;
628 raid_io->iovs = bdev_io->u.bdev.iovs;
644 raid_io->num_blocks = bdev_io->u.bdev.num_blocks;
645 raid_io->iovcnt = bdev_io->u.bdev.iovcnt;
646 raid_io->iovs = bdev_io->u.bdev.iovs;
656 spdk_bdev_get_dif_type(bdev_io->bdev) != SPDK_DIF_DISABLE &&
657 bdev_io->bdev->dif_check_flags & SPDK_DIF_FLAGS_REFTAG_CHECK &&
660 rc = raid_bdev_remap_dix_reftag(bdev_io->u.bdev.md_buf,
661 bdev_io->u.bdev.num_blocks, bdev_io->bdev,
662 bdev_io->u.bdev.offset_blocks);
674 * base bdev IOs and complete the raid_io if this is the final expected IO.
710 * It will try to queue the IOs after storing the context to bdev wait queue logic.
713 * bdev - the block device that the IO is submitted to
715 * cb_fn - callback when the spdk_bdev_io for bdev becomes available
720 raid_bdev_queue_io_wait(struct raid_bdev_io *raid_io, struct spdk_bdev *bdev,
723 raid_io->waitq_entry.bdev = bdev;
726 spdk_bdev_queue_io_wait(bdev, ch, &raid_io->waitq_entry);
793 SPDK_ERRLOG("bdev io submit error not due to ENOMEM, it should not happen\n");
805 size_t iov_offset = split_offset * raid_bdev->bdev.blocklen;
815 raid_io->md_buf += (split_offset * raid_bdev->bdev.md_len);
857 * deferred by the bdev layer until the window is unlocked.
876 * ch - pointer to raid bdev io channel
877 * bdev_io - pointer to parent bdev_io on raid bdev device
893 raid_io->iovs = bdev_io->u.bdev.iovs;
894 raid_io->iovcnt = bdev_io->u.bdev.iovcnt;
895 raid_io->md_buf = bdev_io->u.bdev.md_buf;
931 * raid bdev function table. This is used to submit the io on raid_bdev to below
934 * ch - pointer to raid bdev io channel
935 * bdev_io - pointer to parent bdev_io on raid bdev device
945 bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks,
946 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.md_buf,
947 bdev_io->u.bdev.memory_domain, bdev_io->u.bdev.memory_domain_ctx);
954 bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
984 * all base bdev modules of raid bdev module. If anyone among the base_bdevs
988 * raid_bdev - pointer to raid bdev context
1021 * raid_bdev_io_type_supported is the io_supported function for bdev function
1023 * raid bdev module
1025 * ctx - pointer to raid bdev context
1054 * raid bdev. This is used to return the io channel for this raid bdev
1058 * pointer to io channel for raid bdev
1076 spdk_json_write_named_uuid(w, "uuid", &raid_bdev->bdev.uuid);
1095 spdk_json_write_named_uint32(w, "percent", offset * 100.0 / raid_bdev->bdev.blockcnt);
1120 * raid_bdev_dump_info_json is the function table pointer for raid bdev
1135 /* Dump the raid bdev configuration related information */
1145 * raid_bdev_write_config_json is the function table pointer for raid bdev
1147 * bdev - pointer to spdk_bdev
1153 raid_bdev_write_config_json(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)
1155 struct raid_bdev *raid_bdev = bdev->ctxt;
1161 /* raid bdev configuration is stored in the superblock */
1170 spdk_json_write_named_string(w, "name", bdev->name);
1171 spdk_json_write_named_uuid(w, "uuid", &raid_bdev->bdev.uuid);
1236 /* g_raid_bdev_fn_table is the function table for raid bdev */
1253 if (strcmp(raid_bdev->bdev.name, name) == 0) {
1267 if (spdk_uuid_compare(&raid_bdev->bdev.uuid, uuid) == 0) {
1374 * raid_bdev_fini_start is called when bdev layer is starting the
1402 * raid_bdev_exit is called on raid bdev module exit time by bdev layer
1475 * raid_bdev_init is the initialization function for raid bdev module
1500 SPDK_ERRLOG("Raid bdev name '%s' exceeds %d characters\n", name, RAID_BDEV_SB_NAME_SIZE - 1);
1505 SPDK_ERRLOG("Duplicate raid bdev name found: %s\n", name);
1542 SPDK_ERRLOG("Unexpected constraint value '%u' provided for raid bdev '%s'.\n",
1563 SPDK_ERRLOG("Unable to allocate memory for raid bdev\n");
1572 SPDK_ERRLOG("Unable able to allocate base bdev info\n");
1591 raid_bdev_gen = &raid_bdev->bdev;
1616 * raid_bdev_create allocates raid bdev based on passed configuration
1618 * name - name for raid bdev
1623 * uuid - uuid to set for the bdev
1624 * raid_bdev_out - the created raid bdev
1646 /* we need to have the uuid to store in the superblock before the bdev is registered */
1647 spdk_uuid_generate(&raid_bdev->bdev.uuid);
1707 SPDK_ERRLOG("Failed to add raid bdev '%s' process finish action: %s\n",
1708 raid_bdev->bdev.name, spdk_strerror(-rc));
1713 raid_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
1730 struct spdk_bdev *raid_bdev_gen = &raid_bdev->bdev;
1742 SPDK_ERRLOG("Failed to register raid bdev '%s': %s\n",
1748 * Open the bdev internally to delay unregistering if we need to stop a background process
1750 * bdev's internal.spinlock is destroyed by the time the destruct callback is reached.
1751 * During application shutdown, bdevs automatically get unregistered by the bdev layer
1753 * TODO: try to handle this correctly in bdev layer instead.
1758 SPDK_ERRLOG("Failed to open raid bdev '%s': %s\n",
1764 SPDK_DEBUGLOG(bdev_raid, "raid bdev generic %p\n", raid_bdev_gen);
1765 SPDK_DEBUGLOG(bdev_raid, "raid bdev is created with name %s, raid_bdev %p\n",
1788 SPDK_ERRLOG("Failed to write raid bdev '%s' superblock: %s\n",
1789 raid_bdev->bdev.name, spdk_strerror(-status));
1802 * If raid bdev config is complete, then only register the raid bdev to
1803 * bdev layer and remove this raid bdev from configuring list and
1804 * insert the raid bdev to configured list
1806 * raid_bdev - pointer to raid bdev
1814 uint32_t data_block_size = spdk_bdev_get_data_block_size(&raid_bdev->bdev);
1819 assert(raid_bdev->bdev.blocklen > 0);
1848 assert(spdk_uuid_compare(&raid_bdev->sb->uuid, &raid_bdev->bdev.uuid) == 0);
1853 if (raid_bdev->sb->raid_size != raid_bdev->bdev.blockcnt) {
1877 * If raid bdev is online and registered, change the bdev state to
1881 * raid_bdev - pointer to raid bdev
1899 SPDK_DEBUGLOG(bdev_raid, "raid bdev state changing from online to offline\n");
1901 spdk_bdev_unregister(&raid_bdev->bdev, cb_fn, cb_arg);
1906 * raid_bdev_find_base_info_by_bdev function finds the base bdev info by bdev.
1908 * base_bdev - pointer to base bdev
1910 * base bdev info if found, otherwise NULL.
1941 /* There is not enough base bdevs to keep the raid bdev operational. */
1959 SPDK_ERRLOG("Failed to unquiesce raid bdev %s: %s\n",
1960 raid_bdev->bdev.name, spdk_strerror(-status));
1996 spdk_bdev_unquiesce(&raid_bdev->bdev, &g_raid_if, raid_bdev_remove_base_bdev_on_unquiesced,
2015 SPDK_ERRLOG("Failed to write raid bdev '%s' superblock: %s\n",
2016 raid_bdev->bdev.name, spdk_strerror(-status));
2031 SPDK_ERRLOG("Failed to quiesce raid bdev %s: %s\n",
2032 raid_bdev->bdev.name, spdk_strerror(-status));
2067 return spdk_bdev_quiesce(&base_info->raid_bdev->bdev, &g_raid_if,
2155 * after the removal and more than one base bdev may be removed at the same time
2188 * As raid bdev is not registered yet or already unregistered,
2191 * Removing a base bdev at this stage does not change the number of operational
2198 /* There is no base bdev for this raid, so free the raid device. */
2205 /* This raid bdev does not tolerate removing a base bdev. */
2229 * is removed. This function checks if this base bdev is part of any raid bdev
2230 * or not. If yes, it takes necessary action on that particular raid bdev.
2232 * base_bdev - pointer to base bdev which got removed
2247 SPDK_ERRLOG("bdev to remove '%s' not found\n", base_bdev->name);
2260 SPDK_WARNLOG("Failed to remove base bdev %s\n", base_info->name);
2276 SPDK_NOTICELOG("Failing base bdev in slot %d ('%s') of raid bdev '%s'\n",
2277 raid_bdev_base_bdev_slot(base_info), base_info->name, base_info->raid_bdev->bdev.name);
2295 SPDK_ERRLOG("Failed to write raid bdev '%s' superblock after resizing the bdev: %s\n",
2296 raid_bdev->bdev.name, spdk_strerror(-status));
2306 * base_bdev - pointer to base bdev which got resized.
2339 blockcnt_old = raid_bdev->bdev.blockcnt;
2344 SPDK_NOTICELOG("raid bdev '%s': block count was changed from %" PRIu64 " to %" PRIu64 "\n",
2345 raid_bdev->bdev.name, blockcnt_old, raid_bdev->bdev.blockcnt);
2359 sb->raid_size = raid_bdev->bdev.blockcnt;
2370 * bdev - bdev that triggered event.
2376 raid_bdev_event_base_bdev(enum spdk_bdev_event_type type, struct spdk_bdev *bdev,
2383 rc = raid_bdev_remove_base_bdev(bdev, NULL, NULL);
2385 SPDK_ERRLOG("Failed to remove base bdev %s: %s\n",
2386 spdk_bdev_get_name(bdev), spdk_strerror(-rc));
2390 raid_bdev_resize_base_bdev(bdev);
2393 SPDK_NOTICELOG("Unsupported bdev event: type %d\n", type);
2400 * Deletes the specified raid bdev
2402 * raid_bdev - pointer to raid bdev
2411 SPDK_DEBUGLOG(bdev_raid, "delete raid bdev: %s\n", raid_bdev->bdev.name);
2414 SPDK_DEBUGLOG(bdev_raid, "destroying raid bdev %s is already started\n",
2415 raid_bdev->bdev.name);
2429 * As raid bdev is not registered yet or already unregistered,
2437 /* There is no base bdev for this raid, so free the raid device. */
2451 SPDK_ERRLOG("Failed to write raid bdev '%s' superblock after background process finished: %s\n",
2452 raid_bdev->bdev.name, spdk_strerror(-status));
2509 SPDK_ERRLOG("Failed to remove target bdev: %s\n", spdk_strerror(-status));
2521 SPDK_ERRLOG("Failed to unquiesce bdev: %s\n", spdk_strerror(-status));
2542 rc = spdk_bdev_unquiesce(&process->raid_bdev->bdev, &g_raid_if,
2562 SPDK_NOTICELOG("Finished %s on raid bdev %s\n",
2564 raid_bdev->bdev.name);
2571 SPDK_WARNLOG("Finished %s on raid bdev %s: %s\n",
2573 raid_bdev->bdev.name,
2615 SPDK_ERRLOG("Failed to quiesce bdev: %s\n", spdk_strerror(-status));
2632 rc = spdk_bdev_quiesce(&process->raid_bdev->bdev, &g_raid_if,
2695 rc = spdk_bdev_unquiesce_range(&process->raid_bdev->bdev, &g_raid_if,
2767 process_req->iov.iov_len = num_blocks * raid_bdev->bdev.blocklen;
2773 raid_bdev->bdev.name, spdk_strerror(-ret));
2790 const uint64_t offset_end = spdk_min(offset + process->max_window_size, raid_bdev->bdev.blockcnt);
2842 process->qos.bytes_available -= process->window_size * raid_bdev->bdev.blocklen;
2865 rc = spdk_bdev_quiesce_range(&raid_bdev->bdev, &g_raid_if,
2899 if (process->window_offset == raid_bdev->bdev.blockcnt) {
2900 SPDK_DEBUGLOG(bdev_raid, "process completed on %s\n", raid_bdev->bdev.name);
2905 process->max_window_size = spdk_min(raid_bdev->bdev.blockcnt - process->window_offset,
2935 SPDK_NOTICELOG("Started %s on raid bdev %s\n",
2936 raid_bdev_process_to_str(process->type), raid_bdev->bdev.name);
2974 /* a base bdev was removed before we got here */
2980 raid_bdev_process_to_str(process->type), raid_bdev->bdev.name,
2986 raid_bdev->bdev.name, raid_bdev_process_to_str(process->type));
2991 raid_bdev_process_to_str(process->type), raid_bdev->bdev.name);
3049 process_req->iov.iov_len = process->max_window_size * raid_bdev->bdev.blocklen;
3055 if (spdk_bdev_is_md_separate(&raid_bdev->bdev)) {
3056 process_req->md_buf = spdk_dma_malloc(process->max_window_size * raid_bdev->bdev.md_len, 4096, 0);
3096 spdk_bdev_get_data_block_size(&raid_bdev->bdev)),
3097 raid_bdev->bdev.write_unit_size);
3165 /* TODO: defer if rebuild in progress on another base bdev */
3184 * Configure the raid bdev when the number of discovered base bdevs reaches the number
3192 SPDK_ERRLOG("Failed to configure raid bdev: %s\n", spdk_strerror(-rc));
3212 static void raid_bdev_examine_sb(const struct raid_bdev_superblock *sb, struct spdk_bdev *bdev,
3226 if (spdk_uuid_compare(&base_info->raid_bdev->bdev.uuid, &sb->uuid) == 0) {
3227 struct spdk_bdev *bdev = spdk_bdev_desc_get_bdev(base_info->desc);
3230 raid_bdev_examine_sb(sb, bdev, configure_cb, base_info->configure_cb_ctx);
3233 SPDK_ERRLOG("Superblock of a different raid bdev found on bdev %s\n", base_info->name);
3242 SPDK_ERRLOG("Failed to examine bdev %s: %s\n",
3259 struct spdk_bdev *bdev;
3267 * Base bdev can be added by name or uuid. Here we assure both properties are set and valid
3268 * before claiming the bdev.
3277 /* UUID of a bdev is registered as its alias */
3278 bdev = spdk_bdev_get_by_name(uuid_str);
3279 if (bdev == NULL) {
3283 bdev_name = spdk_bdev_get_name(bdev);
3292 SPDK_ERRLOG("Name mismatch for base bdev '%s' - expected '%s'\n",
3303 SPDK_ERRLOG("Unable to create desc on bdev '%s'\n", base_info->name);
3308 bdev = spdk_bdev_desc_get_bdev(desc);
3309 bdev_uuid = spdk_bdev_get_uuid(bdev);
3314 SPDK_ERRLOG("UUID mismatch for base bdev '%s'\n", base_info->name);
3319 rc = spdk_bdev_module_claim_bdev(bdev, NULL, &g_raid_if);
3321 SPDK_ERRLOG("Unable to claim this bdev as it is already claimed\n");
3326 SPDK_DEBUGLOG(bdev_raid, "bdev %s is claimed\n", bdev->name);
3331 spdk_bdev_module_release_bdev(bdev);
3337 base_info->blockcnt = bdev->blockcnt;
3343 assert((RAID_BDEV_MIN_DATA_OFFSET_SIZE % spdk_bdev_get_data_block_size(bdev)) == 0);
3344 data_offset = RAID_BDEV_MIN_DATA_OFFSET_SIZE / spdk_bdev_get_data_block_size(bdev);
3349 if (bdev->optimal_io_boundary != 0) {
3351 bdev->optimal_io_boundary) * bdev->optimal_io_boundary;
3353 SPDK_WARNLOG("Data offset %lu on bdev '%s' is different than optimal value %lu\n",
3362 if (base_info->data_offset >= bdev->blockcnt) {
3363 SPDK_ERRLOG("Data offset %lu exceeds base bdev capacity %lu on bdev '%s'\n",
3364 base_info->data_offset, bdev->blockcnt, base_info->name);
3370 base_info->data_size = bdev->blockcnt - base_info->data_offset;
3371 } else if (base_info->data_offset + base_info->data_size > bdev->blockcnt) {
3372 SPDK_ERRLOG("Data offset and size exceeds base bdev capacity %lu on bdev '%s'\n",
3373 bdev->blockcnt, base_info->name);
3378 if (!raid_bdev->module->dif_supported && spdk_bdev_get_dif_type(bdev) != SPDK_DIF_DISABLE) {
3379 SPDK_ERRLOG("Base bdev '%s' has DIF or DIX enabled - unsupported RAID configuration\n",
3380 bdev->name);
3386 * Set the raid bdev properties if this is the first base bdev configured,
3387 * otherwise - verify. Assumption is that all the base bdevs for any raid bdev should
3390 if (raid_bdev->bdev.blocklen == 0) {
3391 raid_bdev->bdev.blocklen = bdev->blocklen;
3392 raid_bdev->bdev.md_len = spdk_bdev_get_md_size(bdev);
3393 raid_bdev->bdev.md_interleave = spdk_bdev_is_md_interleaved(bdev);
3394 raid_bdev->bdev.dif_type = spdk_bdev_get_dif_type(bdev);
3395 raid_bdev->bdev.dif_check_flags = bdev->dif_check_flags;
3396 raid_bdev->bdev.dif_is_head_of_md = spdk_bdev_is_dif_head_of_md(bdev);
3397 raid_bdev->bdev.dif_pi_format = bdev->dif_pi_format;
3399 if (raid_bdev->bdev.blocklen != bdev->blocklen) {
3400 SPDK_ERRLOG("Raid bdev '%s' blocklen %u differs from base bdev '%s' blocklen %u\n",
3401 raid_bdev->bdev.name, raid_bdev->bdev.blocklen, bdev->name, bdev->blocklen);
3406 if (raid_bdev->bdev.md_len != spdk_bdev_get_md_size(bdev) ||
3407 raid_bdev->bdev.md_interleave != spdk_bdev_is_md_interleaved(bdev) ||
3408 raid_bdev->bdev.dif_type != spdk_bdev_get_dif_type(bdev) ||
3409 raid_bdev->bdev.dif_check_flags != bdev->dif_check_flags ||
3410 raid_bdev->bdev.dif_is_head_of_md != spdk_bdev_is_dif_head_of_md(bdev) ||
3411 raid_bdev->bdev.dif_pi_format != bdev->dif_pi_format) {
3412 SPDK_ERRLOG("Raid bdev '%s' has different metadata format than base bdev '%s'\n",
3413 raid_bdev->bdev.name, bdev->name);
3426 /* check for existing superblock when using a new bdev */
3430 SPDK_ERRLOG("Failed to read bdev %s superblock: %s\n",
3431 bdev->name, spdk_strerror(-rc));
3453 SPDK_ERRLOG("raid bdev '%s' is in process\n",
3454 raid_bdev->bdev.name);
3459 struct spdk_bdev *bdev = spdk_bdev_get_by_name(name);
3461 if (bdev != NULL) {
3464 spdk_uuid_compare(&bdev->uuid, &iter->uuid) == 0) {
3482 SPDK_ERRLOG("no empty slot found in raid bdev '%s' for new base bdev '%s'\n",
3483 raid_bdev->bdev.name, name);
3501 SPDK_ERRLOG("base bdev '%s' configure failed: %s\n", name, spdk_strerror(-rc));
3549 raid_bdev_examine_no_sb(struct spdk_bdev *bdev)
3560 ((base_info->name != NULL && strcmp(bdev->name, base_info->name) == 0) ||
3561 spdk_uuid_compare(&base_info->uuid, &bdev->uuid) == 0)) {
3587 typedef void (*raid_bdev_examine_load_sb_cb)(struct spdk_bdev *bdev,
3591 static void raid_bdev_examine_sb(const struct raid_bdev_superblock *sb, struct spdk_bdev *bdev,
3596 raid_bdev_examine_others_load_cb(struct spdk_bdev *bdev, const struct raid_bdev_superblock *sb,
3606 raid_bdev_examine_sb(sb, bdev, raid_bdev_examine_others, ctx);
3653 raid_bdev_examine_sb(const struct raid_bdev_superblock *sb, struct spdk_bdev *bdev,
3662 if (sb->block_size != spdk_bdev_get_data_block_size(bdev)) {
3664 bdev->name, sb->block_size, spdk_bdev_get_data_block_size(bdev));
3670 SPDK_WARNLOG("NULL raid bdev UUID in superblock on bdev %s\n", bdev->name);
3686 "raid superblock seq_number on bdev %s (%lu) greater than existing raid bdev %s (%lu)\n",
3687 bdev->name, sb->seq_number, raid_bdev->bdev.name, raid_bdev->sb->seq_number);
3690 SPDK_WARNLOG("Newer version of raid bdev %s superblock found on bdev %s but raid bdev is not in configuring state.\n",
3691 raid_bdev->bdev.name, bdev->name);
3696 /* remove and then recreate the raid bdev using the newer superblock */
3701 "raid superblock seq_number on bdev %s (%lu) smaller than existing raid bdev %s (%lu)\n",
3702 bdev->name, sb->seq_number, raid_bdev->bdev.name, raid_bdev->sb->seq_number);
3703 /* use the current raid bdev superblock */
3713 if (spdk_uuid_compare(&sb_base_bdev->uuid, spdk_bdev_get_uuid(bdev)) == 0) {
3719 SPDK_DEBUGLOG(bdev_raid, "raid superblock does not contain this bdev's uuid\n");
3735 SPDK_ERRLOG("Failed to create raid bdev %s: %s\n",
3741 /* after this base bdev is configured, examine other base bdevs that may be present */
3758 SPDK_NOTICELOG("Re-adding bdev %s to raid bdev %s.\n", bdev->name, raid_bdev->bdev.name);
3761 SPDK_ERRLOG("Failed to configure bdev %s as base bdev of raid %s: %s\n",
3762 bdev->name, raid_bdev->bdev.name, spdk_strerror(-rc));
3768 SPDK_NOTICELOG("Bdev %s is not an active member of raid bdev %s. Ignoring.\n",
3769 bdev->name, raid_bdev->bdev.name);
3776 if (spdk_uuid_compare(&iter->uuid, spdk_bdev_get_uuid(bdev)) == 0) {
3783 SPDK_ERRLOG("Bdev %s is not a member of raid bdev %s\n",
3784 bdev->name, raid_bdev->bdev.name);
3796 SPDK_ERRLOG("Failed to configure bdev %s as base bdev of raid %s: %s\n",
3797 bdev->name, raid_bdev->bdev.name, spdk_strerror(-rc));
3834 struct spdk_bdev *bdev = spdk_bdev_desc_get_bdev(ctx->desc);
3836 ctx->cb(bdev, sb, status, ctx->cb_ctx);
3842 raid_bdev_examine_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
3861 SPDK_ERRLOG("Failed to open bdev %s: %s\n", bdev_name, spdk_strerror(-rc));
3867 SPDK_ERRLOG("Failed to get io channel for bdev %s\n", bdev_name);
3877 SPDK_ERRLOG("Failed to read bdev %s superblock: %s\n",
3891 struct spdk_bdev *bdev = ctx;
3894 SPDK_ERRLOG("Failed to examine bdev %s: %s\n",
3895 bdev->name, spdk_strerror(-status));
3901 raid_bdev_examine_cont(struct spdk_bdev *bdev, const struct raid_bdev_superblock *sb, int status,
3907 SPDK_DEBUGLOG(bdev_raid, "raid superblock found on bdev %s\n", bdev->name);
3908 raid_bdev_examine_sb(sb, bdev, raid_bdev_examine_done, bdev);
3912 raid_bdev_examine_no_sb(bdev);
3917 raid_bdev_examine_done(bdev, status);
3923 * like bdev_nvme layer. This function will check if this base bdev can be
3924 * claimed by this raid bdev or not.
3926 * bdev - pointer to base bdev
3931 raid_bdev_examine(struct spdk_bdev *bdev)
3935 if (raid_bdev_find_base_info_by_bdev(bdev) != NULL) {
3939 if (spdk_bdev_get_dif_type(bdev) != SPDK_DIF_DISABLE) {
3940 raid_bdev_examine_no_sb(bdev);
3944 rc = raid_bdev_examine_load_sb(bdev->name, raid_bdev_examine_cont, NULL);
3951 raid_bdev_examine_done(bdev, rc);
3954 /* Log component for bdev raid bdev module */