Lines Matching refs:vbdev
40 /* The crypto vbdev channel struct. It is allocated and freed on my behalf by the io channel code.
262 * in NULL, we need to own the buffer so it doesn't get freed by another vbdev module
304 /* Called when someone submits IO to this crypto vbdev. For IO's not relevant to crypto,
454 * we created our crypto vbdev in examine() which, for this bdev, is the address of one of
472 /* This is the output for bdev_get_bdevs() for this vbdev */
551 /* Create the association from the bdev and vbdev name and insert
617 SPDK_NOTICELOG("vbdev creation deferred pending base bdev arrival\n");
769 struct vbdev_crypto *vbdev;
791 vbdev = calloc(1, sizeof(struct vbdev_crypto));
792 if (!vbdev) {
796 vbdev->crypto_bdev.product_name = "crypto";
798 vbdev->crypto_bdev.name = strdup(name->opts->vbdev_name);
799 if (!vbdev->crypto_bdev.name) {
806 NULL, &vbdev->base_desc);
814 bdev = spdk_bdev_desc_get_bdev(vbdev->base_desc);
815 vbdev->base_bdev = bdev;
817 vbdev->crypto_bdev.write_cache = bdev->write_cache;
818 vbdev->crypto_bdev.optimal_io_boundary = bdev->optimal_io_boundary;
819 vbdev->crypto_bdev.max_rw_size = spdk_min(
825 vbdev->crypto_bdev.required_alignment =
830 vbdev->crypto_bdev.blocklen = bdev->blocklen;
831 vbdev->crypto_bdev.blockcnt = bdev->blockcnt;
836 vbdev->crypto_bdev.ctxt = vbdev;
837 vbdev->crypto_bdev.fn_table = &vbdev_crypto_fn_table;
838 vbdev->crypto_bdev.module = &crypto_if;
842 vbdev->opts = name->opts;
845 rc = spdk_uuid_generate_sha1(&vbdev->crypto_bdev.uuid, &ns_uuid,
846 (const char *)&vbdev->base_bdev->uuid, sizeof(struct spdk_uuid));
852 TAILQ_INSERT_TAIL(&g_vbdev_crypto, vbdev, link);
854 spdk_io_device_register(vbdev, crypto_bdev_ch_create_cb, crypto_bdev_ch_destroy_cb,
855 sizeof(struct crypto_io_channel), vbdev->crypto_bdev.name);
858 vbdev->thread = spdk_get_thread();
860 rc = spdk_bdev_module_claim_bdev(bdev, vbdev->base_desc, vbdev->crypto_bdev.module);
866 rc = spdk_bdev_register(&vbdev->crypto_bdev);
868 SPDK_ERRLOG("Failed to register vbdev: error %d\n", rc);
873 vbdev->opts->vbdev_name);
881 spdk_bdev_module_release_bdev(vbdev->base_bdev);
883 TAILQ_REMOVE(&g_vbdev_crypto, vbdev, link);
884 spdk_io_device_unregister(vbdev, NULL);
886 spdk_bdev_close(vbdev->base_desc);
888 free(vbdev->crypto_bdev.name);
890 free(vbdev);
907 /* Remove the association (vbdev, bdev) from g_bdev_names. This is required so that the
908 * vbdev does not get re-created if the same bdev is constructed at some other time,
923 /* RPC entry for deleting a crypto vbdev. */