Lines Matching full:completion

15  * vdo_run_completion() - Run a completion's callback or error handler on the current thread.
19 static inline void vdo_run_completion(struct vdo_completion *completion) in vdo_run_completion() argument
21 if ((completion->result != VDO_SUCCESS) && (completion->error_handler != NULL)) { in vdo_run_completion()
22 completion->error_handler(completion); in vdo_run_completion()
26 completion->callback(completion); in vdo_run_completion()
29 void vdo_set_completion_result(struct vdo_completion *completion, int result);
31 void vdo_initialize_completion(struct vdo_completion *completion, struct vdo *vdo,
35 * vdo_reset_completion() - Reset a completion to a clean state, while keeping the type, vdo and
38 static inline void vdo_reset_completion(struct vdo_completion *completion) in vdo_reset_completion() argument
40 completion->result = VDO_SUCCESS; in vdo_reset_completion()
41 completion->complete = false; in vdo_reset_completion()
44 void vdo_launch_completion_with_priority(struct vdo_completion *completion,
48 * vdo_launch_completion() - Launch a completion with default priority.
50 static inline void vdo_launch_completion(struct vdo_completion *completion) in vdo_launch_completion() argument
52 vdo_launch_completion_with_priority(completion, VDO_WORK_Q_DEFAULT_PRIORITY); in vdo_launch_completion()
56 * vdo_continue_completion() - Continue processing a completion.
59 * Continue processing a completion by setting the current result and calling
62 static inline void vdo_continue_completion(struct vdo_completion *completion, int result) in vdo_continue_completion() argument
64 vdo_set_completion_result(completion, result); in vdo_continue_completion()
65 vdo_launch_completion(completion); in vdo_continue_completion()
68 void vdo_finish_completion(struct vdo_completion *completion);
71 * vdo_fail_completion() - Set the result of a completion if it does not already have an error,
74 static inline void vdo_fail_completion(struct vdo_completion *completion, int result) in vdo_fail_completion() argument
76 vdo_set_completion_result(completion, result); in vdo_fail_completion()
77 vdo_finish_completion(completion); in vdo_fail_completion()
81 * vdo_assert_completion_type() - Assert that a completion is of the correct type.
85 static inline int vdo_assert_completion_type(struct vdo_completion *completion, in vdo_assert_completion_type() argument
88 return VDO_ASSERT(expected == completion->type, in vdo_assert_completion_type()
89 "completion type should be %u, not %u", expected, in vdo_assert_completion_type()
90 completion->type); in vdo_assert_completion_type()
93 static inline void vdo_set_completion_callback(struct vdo_completion *completion, in vdo_set_completion_callback() argument
97 completion->callback = callback; in vdo_set_completion_callback()
98 completion->callback_thread_id = callback_thread_id; in vdo_set_completion_callback()
102 * vdo_launch_completion_callback() - Set the callback for a completion and launch it immediately.
104 static inline void vdo_launch_completion_callback(struct vdo_completion *completion, in vdo_launch_completion_callback() argument
108 vdo_set_completion_callback(completion, callback, callback_thread_id); in vdo_launch_completion_callback()
109 vdo_launch_completion(completion); in vdo_launch_completion_callback()
113 * vdo_prepare_completion() - Prepare a completion for launch.
115 * Resets the completion, and then sets its callback, error handler, callback thread, and parent.
117 static inline void vdo_prepare_completion(struct vdo_completion *completion, in vdo_prepare_completion() argument
122 vdo_reset_completion(completion); in vdo_prepare_completion()
123 vdo_set_completion_callback(completion, callback, callback_thread_id); in vdo_prepare_completion()
124 completion->error_handler = error_handler; in vdo_prepare_completion()
125 completion->parent = parent; in vdo_prepare_completion()
129 * vdo_prepare_completion_for_requeue() - Prepare a completion for launch ensuring that it will
132 * Resets the completion, and then sets its callback, error handler, callback thread, and parent.
134 static inline void vdo_prepare_completion_for_requeue(struct vdo_completion *completion, in vdo_prepare_completion_for_requeue() argument
140 vdo_prepare_completion(completion, callback, error_handler, in vdo_prepare_completion_for_requeue()
142 completion->requeue = true; in vdo_prepare_completion_for_requeue()
145 void vdo_enqueue_completion(struct vdo_completion *completion,
149 bool vdo_requeue_completion_if_needed(struct vdo_completion *completion,