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>
47 #include "completion.h"
66 struct completion completion; member
481 vdo_initialize_completion(&vdo->admin.completion, vdo, VDO_ADMIN_COMPLETION); in initialize_vdo()
747 * @completion: The super block vio.
751 static void finish_reading_super_block(struct vdo_completion *completion) in finish_reading_super_block() argument
754 container_of(as_vio(completion), struct vdo_super_block, vio); in finish_reading_super_block()
756 vdo_continue_completion(vdo_forget(completion->parent), in finish_reading_super_block()
762 * @completion: The super block vio.
766 static void handle_super_block_read_error(struct vdo_completion *completion) in handle_super_block_read_error() argument
768 vio_record_metadata_io_error(as_vio(completion)); in handle_super_block_read_error()
769 finish_reading_super_block(completion); in handle_super_block_read_error()
775 struct vdo_completion *parent = vio->completion.parent; in read_super_block_endio()
784 * @parent: The completion to notify after loading the super block.
796 vdo->super_block.vio.completion.parent = parent; in vdo_load_super_block()
910 * @completion: The super block vio.
914 static void continue_super_block_parent(struct vdo_completion *completion) in continue_super_block_parent() argument
916 vdo_continue_completion(vdo_forget(completion->parent), completion->result); in continue_super_block_parent()
921 * @completion: The super block vio.
925 static void handle_save_error(struct vdo_completion *completion) in handle_save_error() argument
928 container_of(as_vio(completion), struct vdo_super_block, vio); in handle_save_error()
931 vdo_log_error_strerror(completion->result, "super block save failed"); in handle_save_error()
941 completion->callback(completion); in handle_save_error()
947 struct vdo_completion *parent = vio->completion.parent; in super_block_write_endio()
956 * @parent: The completion to notify when the save is complete.
967 if (super_block->vio.completion.parent != NULL) { in vdo_save_components()
975 super_block->vio.completion.parent = parent; in vdo_save_components()
976 super_block->vio.completion.callback_thread_id = parent->callback_thread_id; in vdo_save_components()
1024 * @parent: The completion to notify in order to acknowledge the notification.
1061 vdo_initialize_completion(¬ifier->completion, vdo, in vdo_enable_read_only_entry()
1075 * @parent: The completion to notify when no threads are entering read-only mode.
1110 * @completion: The completion to convert.
1112 * Return: The completion as a read_only_notifier.
1114 static inline struct read_only_notifier *as_notifier(struct vdo_completion *completion) in as_notifier() argument
1116 vdo_assert_completion_type(completion, VDO_READ_ONLY_MODE_COMPLETION); in as_notifier()
1117 return container_of(completion, struct read_only_notifier, completion); in as_notifier()
1122 * @completion: The read-only mode completion.
1124 static void finish_entering_read_only_mode(struct vdo_completion *completion) in finish_entering_read_only_mode() argument
1126 struct read_only_notifier *notifier = as_notifier(completion); in finish_entering_read_only_mode()
1128 vdo_assert_on_admin_thread(completion->vdo, __func__); in finish_entering_read_only_mode()
1136 completion->result); in finish_entering_read_only_mode()
1141 * @completion: The read-only mode completion.
1143 static void make_thread_read_only(struct vdo_completion *completion) in make_thread_read_only() argument
1145 struct vdo *vdo = completion->vdo; in make_thread_read_only()
1146 thread_id_t thread_id = completion->callback_thread_id; in make_thread_read_only()
1147 struct read_only_notifier *notifier = as_notifier(completion); in make_thread_read_only()
1148 struct read_only_listener *listener = completion->parent; in make_thread_read_only()
1166 vdo_prepare_completion(completion, make_thread_read_only, in make_thread_read_only()
1169 listener->notify(listener->listener, completion); in make_thread_read_only()
1184 vdo_prepare_completion(completion, finish_entering_read_only_mode, in make_thread_read_only()
1188 vdo_prepare_completion(completion, make_thread_read_only, in make_thread_read_only()
1192 vdo_launch_completion(completion); in make_thread_read_only()
1237 make_thread_read_only(¬ifier->completion); in vdo_allow_read_only_mode_entry()
1282 vdo_launch_completion_callback(¬ifier->completion, make_thread_read_only, 0); in vdo_enter_read_only_mode()
1338 * @completion: The sync completion.
1340 static void complete_synchronous_action(struct vdo_completion *completion) in complete_synchronous_action() argument
1342 vdo_assert_completion_type(completion, VDO_SYNC_COMPLETION); in complete_synchronous_action()
1343 complete(&(container_of(completion, struct sync_completion, in complete_synchronous_action()
1344 vdo_completion)->completion)); in complete_synchronous_action()
1352 * @parent: The parent of the sync completion (may be NULL).
1360 init_completion(&sync.completion); in perform_synchronous_action()
1363 wait_for_completion(&sync.completion); in perform_synchronous_action()
1369 * @completion: The completion.
1371 static void set_compression_callback(struct vdo_completion *completion) in set_compression_callback() argument
1373 struct vdo *vdo = completion->vdo; in set_compression_callback()
1374 bool *enable = completion->parent; in set_compression_callback()
1387 complete_synchronous_action(completion); in set_compression_callback()
1579 * @completion: The completion.
1583 static void vdo_fetch_statistics_callback(struct vdo_completion *completion) in vdo_fetch_statistics_callback() argument
1585 get_vdo_statistics(completion->vdo, completion->parent); in vdo_fetch_statistics_callback()
1586 complete_synchronous_action(completion); in vdo_fetch_statistics_callback()
1601 * vdo_get_callback_thread_id() - Get the id of the callback thread on which a completion is