Lines Matching refs:action
55 static void bdev_ftl_action_finish(struct bdev_ftl_action *action);
56 static void *bdev_ftl_action_ctx(struct bdev_ftl_action *action, size_t size);
504 struct bdev_ftl_action *action; in bdev_ftl_unmap() local
506 action = bdev_ftl_action_start(name, 0, cb_fn, cb_arg); in bdev_ftl_unmap()
507 if (!action) { in bdev_ftl_unmap()
512 action->rc = spdk_ftl_unmap(action->ftl_bdev_dev->dev, NULL, NULL, lba, num_blocks, in bdev_ftl_unmap()
513 bdev_ftl_action_finish_cb, action); in bdev_ftl_unmap()
514 if (action->rc) { in bdev_ftl_unmap()
515 bdev_ftl_action_finish(action); in bdev_ftl_unmap()
522 struct bdev_ftl_action *action = cb_arg; in bdev_ftl_get_stats_cb() local
524 bdev_ftl_action_finish(action); in bdev_ftl_get_stats_cb()
530 struct bdev_ftl_action *action; in bdev_ftl_get_stats() local
532 action = bdev_ftl_action_start(name, 0, cb, ftl_stats_ctx); in bdev_ftl_get_stats()
533 if (!action) { in bdev_ftl_get_stats()
536 ftl_stats_ctx->ftl_bdev_desc = action->ftl_bdev_desc; in bdev_ftl_get_stats()
537 action->rc = spdk_ftl_get_stats(action->ftl_bdev_dev->dev, &ftl_stats_ctx->ftl_stats, in bdev_ftl_get_stats()
538 bdev_ftl_get_stats_cb, action); in bdev_ftl_get_stats()
539 if (action->rc) { in bdev_ftl_get_stats()
540 bdev_ftl_action_finish(action); in bdev_ftl_get_stats()
547 struct bdev_ftl_action *action; in bdev_ftl_get_properties() local
549 action = bdev_ftl_action_start(name, 0, cb_fn, request); in bdev_ftl_get_properties()
550 if (!action) { in bdev_ftl_get_properties()
554 action->rc = spdk_ftl_get_properties(action->ftl_bdev_dev->dev, request, in bdev_ftl_get_properties()
555 bdev_ftl_action_finish_cb, action); in bdev_ftl_get_properties()
556 if (action->rc) { in bdev_ftl_get_properties()
557 bdev_ftl_action_finish(action); in bdev_ftl_get_properties()
569 struct bdev_ftl_action *action = cb_arg; in bdev_ftl_set_property_cb() local
570 struct bdev_ftl_set_property_args *args = bdev_ftl_action_ctx(action, sizeof(*args)); in bdev_ftl_set_property_cb()
583 struct bdev_ftl_action *action; in bdev_ftl_set_property() local
586 action = bdev_ftl_action_start(name, sizeof(*args), cb_fn, cb_arg); in bdev_ftl_set_property()
587 if (!action) { in bdev_ftl_set_property()
591 args = bdev_ftl_action_ctx(action, sizeof(*args)); in bdev_ftl_set_property()
598 action->rc = -ENOMEM; in bdev_ftl_set_property()
599 bdev_ftl_action_finish(action); in bdev_ftl_set_property()
603 action->rc = spdk_ftl_set_property(action->ftl_bdev_dev->dev, in bdev_ftl_set_property()
605 bdev_ftl_set_property_cb, action); in bdev_ftl_set_property()
606 if (action->rc) { in bdev_ftl_set_property()
607 bdev_ftl_action_finish(action); in bdev_ftl_set_property()
661 bdev_ftl_action_finish(struct bdev_ftl_action *action) in SPDK_LOG_REGISTER_COMPONENT()
663 action->cb_fn(action->cb_arg, action->rc); in SPDK_LOG_REGISTER_COMPONENT()
664 if (action->ftl_bdev_desc) { in SPDK_LOG_REGISTER_COMPONENT()
665 spdk_bdev_close(action->ftl_bdev_desc); in SPDK_LOG_REGISTER_COMPONENT()
667 free(action); in SPDK_LOG_REGISTER_COMPONENT()
674 struct bdev_ftl_action *action = calloc(1, sizeof(*action) + ctx_size); in bdev_ftl_action_start() local
676 if (NULL == action) { in bdev_ftl_action_start()
680 action->cb_arg = cb_arg; in bdev_ftl_action_start()
681 action->cb_fn = cb_fn; in bdev_ftl_action_start()
682 action->ctx_size = ctx_size; in bdev_ftl_action_start()
684 action->rc = spdk_bdev_open_ext(bdev_name, false, bdev_ftl_event_cb, NULL, &action->ftl_bdev_desc); in bdev_ftl_action_start()
685 if (action->rc) { in bdev_ftl_action_start()
689 bdev = spdk_bdev_desc_get_bdev(action->ftl_bdev_desc); in bdev_ftl_action_start()
691 action->rc = -ENODEV; in bdev_ftl_action_start()
695 action->ftl_bdev_dev = bdev->ctxt; in bdev_ftl_action_start()
696 assert(action->ftl_bdev_dev); in bdev_ftl_action_start()
698 return action; in bdev_ftl_action_start()
700 bdev_ftl_action_finish(action); in bdev_ftl_action_start()
707 struct bdev_ftl_action *action = cb_arg; in bdev_ftl_action_finish_cb() local
709 action->rc = status; in bdev_ftl_action_finish_cb()
710 bdev_ftl_action_finish(action); in bdev_ftl_action_finish_cb()
714 bdev_ftl_action_ctx(struct bdev_ftl_action *action, size_t size) in bdev_ftl_action_ctx() argument
716 assert(action->ctx_size); in bdev_ftl_action_ctx()
717 assert(size == action->ctx_size); in bdev_ftl_action_ctx()
718 return action->ctx; in bdev_ftl_action_ctx()