Lines Matching defs: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)
21 if ((completion->result != VDO_SUCCESS) && (completion->error_handler != NULL)) {
22 completion->error_handler(completion);
26 completion->callback(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)
40 completion->result = VDO_SUCCESS;
41 completion->complete = false;
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)
52 vdo_launch_completion_with_priority(completion, VDO_WORK_Q_DEFAULT_PRIORITY);
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)
64 vdo_set_completion_result(completion, result);
65 vdo_launch_completion(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)
76 vdo_set_completion_result(completion, result);
77 vdo_finish_completion(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,
88 return VDO_ASSERT(expected == completion->type,
89 "completion type should be %u, not %u", expected,
90 completion->type);
93 static inline void vdo_set_completion_callback(struct vdo_completion *completion,
97 completion->callback = callback;
98 completion->callback_thread_id = callback_thread_id;
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,
108 vdo_set_completion_callback(completion, callback, callback_thread_id);
109 vdo_launch_completion(completion);
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,
122 vdo_reset_completion(completion);
123 vdo_set_completion_callback(completion, callback, callback_thread_id);
124 completion->error_handler = error_handler;
125 completion->parent = parent;
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,
140 vdo_prepare_completion(completion, callback, error_handler,
142 completion->requeue = true;
145 void vdo_enqueue_completion(struct vdo_completion *completion,
149 bool vdo_requeue_completion_if_needed(struct vdo_completion *completion,