Lines Matching refs:base
93 /* Get existing cache base
96 get_other_cache_base(struct vbdev_ocf_base *base)
101 if (&vbdev->cache == base || !vbdev->cache.attached) {
104 if (!strcmp(vbdev->cache.name, base->name)) {
160 /* Close and unclaim base bdev */
162 remove_base_bdev(struct vbdev_ocf_base *base)
164 if (base->attached) {
165 if (base->management_channel) {
166 spdk_put_io_channel(base->management_channel);
169 spdk_bdev_module_release_bdev(base->bdev);
171 if (base->thread && base->thread != spdk_get_thread()) {
172 spdk_thread_send_msg(base->thread, _remove_base_bdev, base->desc);
174 spdk_bdev_close(base->desc);
176 base->attached = false;
228 /* Detach core base */
246 /* Detach cache base */
503 /* Return matching base if parent vbdev is online */
529 /* Execute fn for each OCF device that is online or waits for base devices */
929 /* Copy properties of the base bdev */
942 /* Generate UUID based on namespace UUID + base bdev UUID. */
1348 /* When base device gets unplugged this is called
1352 hotremove_cb(struct vbdev_ocf_base *base)
1356 if (!base->is_cache) {
1357 if (base->parent->state.doing_finish) {
1362 base->parent->name, base->name);
1363 vbdev_ocf_delete(base->parent, NULL, NULL);
1371 if (strcmp(base->name, vbdev->cache.name) == 0) {
1374 vbdev->name, base->name);
1396 /* Open base SPDK bdev and claim it */
1398 attach_base(struct vbdev_ocf_base *base)
1402 if (base->attached) {
1406 /* If base cache bdev was already opened by other vbdev,
1408 if (base->is_cache) {
1409 struct vbdev_ocf_base *existing = get_other_cache_base(base);
1411 base->desc = existing->desc;
1412 base->management_channel = existing->management_channel;
1413 base->attached = true;
1418 status = spdk_bdev_open_ext(base->name, true, base_bdev_event_cb, base, &base->desc);
1420 SPDK_ERRLOG("Unable to open device '%s' for writing\n", base->name);
1424 status = spdk_bdev_module_claim_bdev(base->bdev, base->desc,
1427 SPDK_ERRLOG("Unable to claim device '%s'\n", base->name);
1428 spdk_bdev_close(base->desc);
1432 base->management_channel = spdk_bdev_get_io_channel(base->desc);
1433 if (!base->management_channel) {
1434 SPDK_ERRLOG("Unable to get io channel '%s'\n", base->name);
1435 spdk_bdev_module_release_bdev(base->bdev);
1436 spdk_bdev_close(base->desc);
1440 /* Save the thread where the base device is opened */
1441 base->thread = spdk_get_thread();
1443 base->attached = true;
1447 /* Attach base bdevs */
1468 /* Init and then start vbdev if all base devices are present */
1590 * If that device named as one of base bdevs of OCF vbdev,
1616 struct vbdev_ocf_base base;
1646 spdk_bdev_get_name(ctx->base.bdev), ctx->result);
1649 if (ctx->base.desc) {
1651 if (ctx->base.thread && ctx->base.thread != spdk_get_thread()) {
1652 spdk_thread_send_msg(ctx->base.thread, _examine_ctx_put, ctx->base.desc);
1654 spdk_bdev_close(ctx->base.desc);
1669 examine_done(ctx->result, NULL, ctx->base.bdev);
1692 * If vbdev has all of its base devices it starts asynchronously here
1732 * We create temporary OCF volume and a temporary base structure
1741 ctx->base.bdev = bdev;
1744 rc = spdk_bdev_open_ext(bdev_name, true, base_bdev_event_cb, NULL, &ctx->base.desc);
1758 rc = ocf_volume_open(ctx->volume, &ctx->base);
1765 /* Save the thread where the base device is opened */
1766 ctx->base.thread = spdk_get_thread();