@@ -73,7 +73,7 @@ struct async_entry {
7373 struct list_head global_list ;
7474 struct work_struct work ;
7575 async_cookie_t cookie ;
76- async_func_ptr * func ;
76+ async_func_t func ;
7777 void * data ;
7878 struct async_domain * domain ;
7979};
@@ -84,24 +84,20 @@ static atomic_t entry_count;
8484
8585static async_cookie_t lowest_in_progress (struct async_domain * domain )
8686{
87- struct async_entry * first = NULL ;
87+ struct list_head * pending ;
8888 async_cookie_t ret = ASYNC_COOKIE_MAX ;
8989 unsigned long flags ;
9090
9191 spin_lock_irqsave (& async_lock , flags );
9292
93- if (domain ) {
94- if (!list_empty (& domain -> pending ))
95- first = list_first_entry (& domain -> pending ,
96- struct async_entry , domain_list );
97- } else {
98- if (!list_empty (& async_global_pending ))
99- first = list_first_entry (& async_global_pending ,
100- struct async_entry , global_list );
101- }
93+ if (domain )
94+ pending = & domain -> pending ;
95+ else
96+ pending = & async_global_pending ;
10297
103- if (first )
104- ret = first -> cookie ;
98+ if (!list_empty (pending ))
99+ ret = list_first_entry (pending , struct async_entry ,
100+ domain_list )-> cookie ;
105101
106102 spin_unlock_irqrestore (& async_lock , flags );
107103 return ret ;
@@ -149,7 +145,7 @@ static void async_run_entry_fn(struct work_struct *work)
149145 wake_up (& async_done );
150146}
151147
152- static async_cookie_t __async_schedule (async_func_ptr * ptr , void * data , struct async_domain * domain )
148+ static async_cookie_t __async_schedule (async_func_t func , void * data , struct async_domain * domain )
153149{
154150 struct async_entry * entry ;
155151 unsigned long flags ;
@@ -169,13 +165,13 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a
169165 spin_unlock_irqrestore (& async_lock , flags );
170166
171167 /* low on memory.. run synchronously */
172- ptr (data , newcookie );
168+ func (data , newcookie );
173169 return newcookie ;
174170 }
175171 INIT_LIST_HEAD (& entry -> domain_list );
176172 INIT_LIST_HEAD (& entry -> global_list );
177173 INIT_WORK (& entry -> work , async_run_entry_fn );
178- entry -> func = ptr ;
174+ entry -> func = func ;
179175 entry -> data = data ;
180176 entry -> domain = domain ;
181177
@@ -202,21 +198,21 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a
202198
203199/**
204200 * async_schedule - schedule a function for asynchronous execution
205- * @ptr : function to execute asynchronously
201+ * @func : function to execute asynchronously
206202 * @data: data pointer to pass to the function
207203 *
208204 * Returns an async_cookie_t that may be used for checkpointing later.
209205 * Note: This function may be called from atomic or non-atomic contexts.
210206 */
211- async_cookie_t async_schedule (async_func_ptr * ptr , void * data )
207+ async_cookie_t async_schedule (async_func_t func , void * data )
212208{
213- return __async_schedule (ptr , data , & async_dfl_domain );
209+ return __async_schedule (func , data , & async_dfl_domain );
214210}
215211EXPORT_SYMBOL_GPL (async_schedule );
216212
217213/**
218214 * async_schedule_domain - schedule a function for asynchronous execution within a certain domain
219- * @ptr : function to execute asynchronously
215+ * @func : function to execute asynchronously
220216 * @data: data pointer to pass to the function
221217 * @domain: the domain
222218 *
@@ -226,10 +222,10 @@ EXPORT_SYMBOL_GPL(async_schedule);
226222 * synchronization domain is specified via @domain. Note: This function
227223 * may be called from atomic or non-atomic contexts.
228224 */
229- async_cookie_t async_schedule_domain (async_func_ptr * ptr , void * data ,
225+ async_cookie_t async_schedule_domain (async_func_t func , void * data ,
230226 struct async_domain * domain )
231227{
232- return __async_schedule (ptr , data , domain );
228+ return __async_schedule (func , data , domain );
233229}
234230EXPORT_SYMBOL_GPL (async_schedule_domain );
235231
0 commit comments