@@ -209,18 +209,43 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct l
209209 return newcookie ;
210210}
211211
212+ /**
213+ * async_schedule - schedule a function for asynchronous execution
214+ * @ptr: function to execute asynchronously
215+ * @data: data pointer to pass to the function
216+ *
217+ * Returns an async_cookie_t that may be used for checkpointing later.
218+ * Note: This function may be called from atomic or non-atomic contexts.
219+ */
212220async_cookie_t async_schedule (async_func_ptr * ptr , void * data )
213221{
214222 return __async_schedule (ptr , data , & async_running );
215223}
216224EXPORT_SYMBOL_GPL (async_schedule );
217225
226+ /**
227+ * async_schedule_special - schedule a function for asynchronous execution with a special running queue
228+ * @ptr: function to execute asynchronously
229+ * @data: data pointer to pass to the function
230+ * @running: list head to add to while running
231+ *
232+ * Returns an async_cookie_t that may be used for checkpointing later.
233+ * @running may be used in the async_synchronize_*_special() functions
234+ * to wait on a special running queue rather than on the global running
235+ * queue.
236+ * Note: This function may be called from atomic or non-atomic contexts.
237+ */
218238async_cookie_t async_schedule_special (async_func_ptr * ptr , void * data , struct list_head * running )
219239{
220240 return __async_schedule (ptr , data , running );
221241}
222242EXPORT_SYMBOL_GPL (async_schedule_special );
223243
244+ /**
245+ * async_synchronize_full - synchronize all asynchronous function calls
246+ *
247+ * This function waits until all asynchronous function calls have been done.
248+ */
224249void async_synchronize_full (void )
225250{
226251 do {
@@ -229,12 +254,27 @@ void async_synchronize_full(void)
229254}
230255EXPORT_SYMBOL_GPL (async_synchronize_full );
231256
257+ /**
258+ * async_synchronize_full_special - synchronize all asynchronous function calls for a running list
259+ * @list: running list to synchronize on
260+ *
261+ * This function waits until all asynchronous function calls for the running
262+ * list @list have been done.
263+ */
232264void async_synchronize_full_special (struct list_head * list )
233265{
234266 async_synchronize_cookie_special (next_cookie , list );
235267}
236268EXPORT_SYMBOL_GPL (async_synchronize_full_special );
237269
270+ /**
271+ * async_synchronize_cookie_special - synchronize asynchronous function calls on a running list with cookie checkpointing
272+ * @cookie: async_cookie_t to use as checkpoint
273+ * @running: running list to synchronize on
274+ *
275+ * This function waits until all asynchronous function calls for the running
276+ * list @list submitted prior to @cookie have been done.
277+ */
238278void async_synchronize_cookie_special (async_cookie_t cookie , struct list_head * running )
239279{
240280 ktime_t starttime , delta , endtime ;
@@ -257,6 +297,13 @@ void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *r
257297}
258298EXPORT_SYMBOL_GPL (async_synchronize_cookie_special );
259299
300+ /**
301+ * async_synchronize_cookie - synchronize asynchronous function calls with cookie checkpointing
302+ * @cookie: async_cookie_t to use as checkpoint
303+ *
304+ * This function waits until all asynchronous function calls prior to @cookie
305+ * have been done.
306+ */
260307void async_synchronize_cookie (async_cookie_t cookie )
261308{
262309 async_synchronize_cookie_special (cookie , & async_running );
0 commit comments