Lines Matching full:completion
14 * A read_only_notifier has a single completion which is used to perform read-only notifications,
32 #include <linux/completion.h>
45 #include "completion.h"
64 struct completion completion; member
473 vdo_initialize_completion(&vdo->admin.completion, vdo, VDO_ADMIN_COMPLETION); in initialize_vdo()
738 * @completion: The super block vio.
742 static void finish_reading_super_block(struct vdo_completion *completion) in finish_reading_super_block() argument
745 container_of(as_vio(completion), struct vdo_super_block, vio); in finish_reading_super_block()
747 vdo_continue_completion(vdo_forget(completion->parent), in finish_reading_super_block()
753 * @completion: The super block vio.
757 static void handle_super_block_read_error(struct vdo_completion *completion) in handle_super_block_read_error() argument
759 vio_record_metadata_io_error(as_vio(completion)); in handle_super_block_read_error()
760 finish_reading_super_block(completion); in handle_super_block_read_error()
766 struct vdo_completion *parent = vio->completion.parent; in read_super_block_endio()
775 * @parent: The completion to notify after loading the super block.
787 vdo->super_block.vio.completion.parent = parent; in vdo_load_super_block()
901 * @completion: The super block vio.
905 static void continue_super_block_parent(struct vdo_completion *completion) in continue_super_block_parent() argument
907 vdo_continue_completion(vdo_forget(completion->parent), completion->result); in continue_super_block_parent()
912 * @completion: The super block vio.
916 static void handle_save_error(struct vdo_completion *completion) in handle_save_error() argument
919 container_of(as_vio(completion), struct vdo_super_block, vio); in handle_save_error()
922 vdo_log_error_strerror(completion->result, "super block save failed"); in handle_save_error()
932 completion->callback(completion); in handle_save_error()
938 struct vdo_completion *parent = vio->completion.parent; in super_block_write_endio()
947 * @parent: The completion to notify when the save is complete.
958 if (super_block->vio.completion.parent != NULL) { in vdo_save_components()
966 super_block->vio.completion.parent = parent; in vdo_save_components()
967 super_block->vio.completion.callback_thread_id = parent->callback_thread_id; in vdo_save_components()
1015 * @parent: The completion to notify in order to acknowledge the notification.
1052 vdo_initialize_completion(¬ifier->completion, vdo, in vdo_enable_read_only_entry()
1066 * @parent: The completion to notify when no threads are entering read-only mode.
1101 * @completion: The completion to convert.
1103 * Return: The completion as a read_only_notifier.
1105 static inline struct read_only_notifier *as_notifier(struct vdo_completion *completion) in as_notifier() argument
1107 vdo_assert_completion_type(completion, VDO_READ_ONLY_MODE_COMPLETION); in as_notifier()
1108 return container_of(completion, struct read_only_notifier, completion); in as_notifier()
1113 * @completion: The read-only mode completion.
1115 static void finish_entering_read_only_mode(struct vdo_completion *completion) in finish_entering_read_only_mode() argument
1117 struct read_only_notifier *notifier = as_notifier(completion); in finish_entering_read_only_mode()
1119 vdo_assert_on_admin_thread(completion->vdo, __func__); in finish_entering_read_only_mode()
1127 completion->result); in finish_entering_read_only_mode()
1132 * @completion: The read-only mode completion.
1134 static void make_thread_read_only(struct vdo_completion *completion) in make_thread_read_only() argument
1136 struct vdo *vdo = completion->vdo; in make_thread_read_only()
1137 thread_id_t thread_id = completion->callback_thread_id; in make_thread_read_only()
1138 struct read_only_notifier *notifier = as_notifier(completion); in make_thread_read_only()
1139 struct read_only_listener *listener = completion->parent; in make_thread_read_only()
1157 vdo_prepare_completion(completion, make_thread_read_only, in make_thread_read_only()
1160 listener->notify(listener->listener, completion); in make_thread_read_only()
1175 vdo_prepare_completion(completion, finish_entering_read_only_mode, in make_thread_read_only()
1179 vdo_prepare_completion(completion, make_thread_read_only, in make_thread_read_only()
1183 vdo_launch_completion(completion); in make_thread_read_only()
1228 make_thread_read_only(¬ifier->completion); in vdo_allow_read_only_mode_entry()
1273 vdo_launch_completion_callback(¬ifier->completion, make_thread_read_only, 0); in vdo_enter_read_only_mode()
1329 * @completion: The sync completion.
1331 static void complete_synchronous_action(struct vdo_completion *completion) in complete_synchronous_action() argument
1333 vdo_assert_completion_type(completion, VDO_SYNC_COMPLETION); in complete_synchronous_action()
1334 complete(&(container_of(completion, struct sync_completion, in complete_synchronous_action()
1335 vdo_completion)->completion)); in complete_synchronous_action()
1343 * @parent: The parent of the sync completion (may be NULL).
1351 init_completion(&sync.completion); in perform_synchronous_action()
1354 wait_for_completion(&sync.completion); in perform_synchronous_action()
1360 * @completion: The completion.
1362 static void set_compression_callback(struct vdo_completion *completion) in set_compression_callback() argument
1364 struct vdo *vdo = completion->vdo; in set_compression_callback()
1365 bool *enable = completion->parent; in set_compression_callback()
1378 complete_synchronous_action(completion); in set_compression_callback()
1570 * @completion: The completion.
1574 static void vdo_fetch_statistics_callback(struct vdo_completion *completion) in vdo_fetch_statistics_callback() argument
1576 get_vdo_statistics(completion->vdo, completion->parent); in vdo_fetch_statistics_callback()
1577 complete_synchronous_action(completion); in vdo_fetch_statistics_callback()
1592 * vdo_get_callback_thread_id() - Get the id of the callback thread on which a completion is