Skip to content

Commit f30d5b3

Browse files
cohuckfenrus75
authored andcommitted
async: Add some documentation.
Add some kerneldoc to the async interface. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
1 parent 86532d8 commit f30d5b3

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

‎kernel/async.c‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
*/
212220
async_cookie_t async_schedule(async_func_ptr *ptr, void *data)
213221
{
214222
return __async_schedule(ptr, data, &async_running);
215223
}
216224
EXPORT_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+
*/
218238
async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *running)
219239
{
220240
return __async_schedule(ptr, data, running);
221241
}
222242
EXPORT_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+
*/
224249
void async_synchronize_full(void)
225250
{
226251
do {
@@ -229,12 +254,27 @@ void async_synchronize_full(void)
229254
}
230255
EXPORT_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+
*/
232264
void async_synchronize_full_special(struct list_head *list)
233265
{
234266
async_synchronize_cookie_special(next_cookie, list);
235267
}
236268
EXPORT_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+
*/
238278
void 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
}
258298
EXPORT_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+
*/
260307
void async_synchronize_cookie(async_cookie_t cookie)
261308
{
262309
async_synchronize_cookie_special(cookie, &async_running);

0 commit comments

Comments
 (0)