Lines Matching refs:bdev
9 * down to a bdev (or bdevs) that its configured to attach to.
30 static void vbdev_passthru_examine(struct spdk_bdev *bdev);
60 struct spdk_bdev pt_bdev; /* the PT virtual bdev */
68 * would be defined. This passthru bdev doesn't actually need to allocate a channel, it could
69 * simply pass back the channel of the bdev underneath it but for example purposes we will
77 * context that we get handed by the bdev layer.
82 /* bdev related */
103 /* Wrapper for the bdev close operation. */
126 /* Unclaim the underlying bdev. */
129 /* Close the underlying bdev on its same opened thread. */
142 /* Completion callback for IO that were issued from this bdev. The original bdev_io
186 spdk_bdev_io_set_buf(orig_io, bdev_io->u.bdev.iovs[0].iov_base, bdev_io->u.bdev.iovs[0].iov_len);
207 io_ctx->bdev_io_wait.bdev = bdev_io->bdev;
212 rc = spdk_bdev_queue_io_wait(bdev_io->bdev, pt_ch->base_ch, &io_ctx->bdev_io_wait);
224 opts->memory_domain = bdev_io->u.bdev.memory_domain;
225 opts->memory_domain_ctx = bdev_io->u.bdev.memory_domain_ctx;
226 opts->metadata = bdev_io->u.bdev.md_buf;
227 opts->dif_check_flags_exclude_mask = ~bdev_io->u.bdev.dif_check_flags;
230 /* Callback for getting a buf from the bdev pool in the event that the caller passed
238 struct vbdev_passthru *pt_node = SPDK_CONTAINEROF(bdev_io->bdev, struct vbdev_passthru,
251 rc = spdk_bdev_readv_blocks_ext(pt_node->base_desc, pt_ch->base_ch, bdev_io->u.bdev.iovs,
252 bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.offset_blocks,
253 bdev_io->u.bdev.num_blocks, _pt_complete_io,
268 * via SPDK IO calls which in turn allocate another bdev IO and call our cpl callback provided
274 struct vbdev_passthru *pt_node = SPDK_CONTAINEROF(bdev_io->bdev, struct vbdev_passthru, pt_bdev);
289 bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
293 rc = spdk_bdev_writev_blocks_ext(pt_node->base_desc, pt_ch->base_ch, bdev_io->u.bdev.iovs,
294 bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.offset_blocks,
295 bdev_io->u.bdev.num_blocks, _pt_complete_io,
300 bdev_io->u.bdev.offset_blocks,
301 bdev_io->u.bdev.num_blocks,
306 bdev_io->u.bdev.offset_blocks,
307 bdev_io->u.bdev.num_blocks,
312 bdev_io->u.bdev.offset_blocks,
313 bdev_io->u.bdev.num_blocks,
322 bdev_io->u.bdev.offset_blocks,
323 bdev_io->u.bdev.num_blocks, bdev_io->u.bdev.zcopy.populate,
332 bdev_io->u.bdev.offset_blocks,
333 bdev_io->u.bdev.copy.src_offset_blocks,
334 bdev_io->u.bdev.num_blocks,
354 /* We'll just call the base bdev and let it answer however if we were more
367 * bdev. This is how they get a channel. We are passed the same context we provided when
368 * we created our PT vbdev in examine() which, for this bdev, is the address of one of
430 * we can communicate with the base bdev on a per channel basis. If we needed
446 * when we created. If this bdev used its own poller, we'd unregister it here.
456 /* Create the passthru association from the bdev and vbdev name and insert
466 SPDK_ERRLOG("passthru bdev %s already exists\n", vbdev_name);
498 /* On init, just perform bdev module specific initialization. */
530 * function is called to output any per bdev specific methods. For the PT module, there are
534 vbdev_passthru_write_config_json(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)
536 /* No config per bdev needed */
544 /* Passthru bdev doesn't work with data buffers, so it supports any memory domain used by base_bdev */
548 /* When we register our bdev this is how we specify our entry points. */
571 /* Called when the underlying base bdev triggers asynchronous event such as bdev removal. */
573 vbdev_passthru_base_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev,
578 vbdev_passthru_base_bdev_hotremove_cb(bdev);
581 SPDK_NOTICELOG("Unsupported bdev event: type %d\n", type);
586 /* Create and register the passthru vbdev if we find it in our list of bdev names.
594 struct spdk_bdev *bdev;
600 /* Check our list of names from config versus this bdev and if
601 * there's a match, create the pt_node & bdev accordingly.
625 /* The base bdev that we're attaching to. */
630 SPDK_ERRLOG("could not open bdev %s\n", bdev_name);
636 SPDK_NOTICELOG("base bdev opened\n");
638 bdev = spdk_bdev_desc_get_bdev(pt_node->base_desc);
639 pt_node->base_bdev = bdev;
645 /* Generate UUID based on namespace UUID + base bdev UUID. */
649 SPDK_ERRLOG("Unable to generate new UUID for passthru bdev\n");
657 /* Copy some properties from the underlying base bdev. */
658 pt_node->pt_bdev.write_cache = bdev->write_cache;
659 pt_node->pt_bdev.required_alignment = bdev->required_alignment;
660 pt_node->pt_bdev.optimal_io_boundary = bdev->optimal_io_boundary;
661 pt_node->pt_bdev.blocklen = bdev->blocklen;
662 pt_node->pt_bdev.blockcnt = bdev->blockcnt;
664 pt_node->pt_bdev.md_interleave = bdev->md_interleave;
665 pt_node->pt_bdev.md_len = bdev->md_len;
666 pt_node->pt_bdev.dif_type = bdev->dif_type;
667 pt_node->pt_bdev.dif_is_head_of_md = bdev->dif_is_head_of_md;
668 pt_node->pt_bdev.dif_check_flags = bdev->dif_check_flags;
669 pt_node->pt_bdev.dif_pi_format = bdev->dif_pi_format;
671 /* This is the context that is passed to us when the bdev
687 rc = spdk_bdev_module_claim_bdev(bdev, pt_node->base_desc, pt_node->pt_bdev.module);
689 SPDK_ERRLOG("could not claim bdev %s\n", bdev_name);
697 SPDK_NOTICELOG("bdev claimed\n");
717 /* Create the passthru disk from the given bdev and vbdev name. */
724 /* Insert the bdev name into our global name list even if it doesn't exist yet,
737 SPDK_NOTICELOG("vbdev creation deferred pending base bdev arrival\n");
753 /* Remove the association (vbdev, bdev) from g_bdev_names. This is required so that the
754 * vbdev does not get re-created if the same bdev is constructed at some other time,
755 * unless the underlying bdev was hot-removed.
771 /* Because we specified this function in our pt bdev function table when we
772 * registered our pt bdev, we'll get this call anytime a new bdev shows up.
774 * parsed the config file at init so we check the new bdev against the list
776 * bdev, here's where we do it.
779 vbdev_passthru_examine(struct spdk_bdev *bdev)
781 vbdev_passthru_register(bdev->name);