aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/super.c4
-rw-r--r--include/linux/async.h8
-rw-r--r--kernel/async.c41
3 files changed, 29 insertions, 24 deletions
diff --git a/fs/super.c b/fs/super.c
index 645e5403f2a0..61dce001dd57 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -301,7 +301,7 @@ void generic_shutdown_super(struct super_block *sb)
301 /* 301 /*
302 * wait for asynchronous fs operations to finish before going further 302 * wait for asynchronous fs operations to finish before going further
303 */ 303 */
304 async_synchronize_full_special(&sb->s_async_list); 304 async_synchronize_full_domain(&sb->s_async_list);
305 305
306 /* bad name - it should be evict_inodes() */ 306 /* bad name - it should be evict_inodes() */
307 invalidate_inodes(sb); 307 invalidate_inodes(sb);
@@ -470,7 +470,7 @@ restart:
470 sb->s_count++; 470 sb->s_count++;
471 spin_unlock(&sb_lock); 471 spin_unlock(&sb_lock);
472 down_read(&sb->s_umount); 472 down_read(&sb->s_umount);
473 async_synchronize_full_special(&sb->s_async_list); 473 async_synchronize_full_domain(&sb->s_async_list);
474 if (sb->s_root && (wait || sb->s_dirt)) 474 if (sb->s_root && (wait || sb->s_dirt))
475 sb->s_op->sync_fs(sb, wait); 475 sb->s_op->sync_fs(sb, wait);
476 up_read(&sb->s_umount); 476 up_read(&sb->s_umount);
diff --git a/include/linux/async.h b/include/linux/async.h
index c4ecacd0b327..68a9530196f2 100644
--- a/include/linux/async.h
+++ b/include/linux/async.h
@@ -17,9 +17,11 @@ typedef u64 async_cookie_t;
17typedef void (async_func_ptr) (void *data, async_cookie_t cookie); 17typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
18 18
19extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); 19extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
20extern async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *list); 20extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
21 struct list_head *list);
21extern void async_synchronize_full(void); 22extern void async_synchronize_full(void);
22extern void async_synchronize_full_special(struct list_head *list); 23extern void async_synchronize_full_domain(struct list_head *list);
23extern void async_synchronize_cookie(async_cookie_t cookie); 24extern void async_synchronize_cookie(async_cookie_t cookie);
24extern void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *list); 25extern void async_synchronize_cookie_domain(async_cookie_t cookie,
26 struct list_head *list);
25 27
diff --git a/kernel/async.c b/kernel/async.c
index b5f0d4b94937..e23399d88bac 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -224,22 +224,23 @@ async_cookie_t async_schedule(async_func_ptr *ptr, void *data)
224EXPORT_SYMBOL_GPL(async_schedule); 224EXPORT_SYMBOL_GPL(async_schedule);
225 225
226/** 226/**
227 * async_schedule_special - schedule a function for asynchronous execution with a special running queue 227 * async_schedule_domain - schedule a function for asynchronous execution within a certain domain
228 * @ptr: function to execute asynchronously 228 * @ptr: function to execute asynchronously
229 * @data: data pointer to pass to the function 229 * @data: data pointer to pass to the function
230 * @running: list head to add to while running 230 * @running: running list for the domain
231 * 231 *
232 * Returns an async_cookie_t that may be used for checkpointing later. 232 * Returns an async_cookie_t that may be used for checkpointing later.
233 * @running may be used in the async_synchronize_*_special() functions 233 * @running may be used in the async_synchronize_*_domain() functions
234 * to wait on a special running queue rather than on the global running 234 * to wait within a certain synchronization domain rather than globally.
235 * queue. 235 * A synchronization domain is specified via the running queue @running to use.
236 * Note: This function may be called from atomic or non-atomic contexts. 236 * Note: This function may be called from atomic or non-atomic contexts.
237 */ 237 */
238async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *running) 238async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
239 struct list_head *running)
239{ 240{
240 return __async_schedule(ptr, data, running); 241 return __async_schedule(ptr, data, running);
241} 242}
242EXPORT_SYMBOL_GPL(async_schedule_special); 243EXPORT_SYMBOL_GPL(async_schedule_domain);
243 244
244/** 245/**
245 * async_synchronize_full - synchronize all asynchronous function calls 246 * async_synchronize_full - synchronize all asynchronous function calls
@@ -255,27 +256,29 @@ void async_synchronize_full(void)
255EXPORT_SYMBOL_GPL(async_synchronize_full); 256EXPORT_SYMBOL_GPL(async_synchronize_full);
256 257
257/** 258/**
258 * async_synchronize_full_special - synchronize all asynchronous function calls for a running list 259 * async_synchronize_full_domain - synchronize all asynchronous function within a certain domain
259 * @list: running list to synchronize on 260 * @list: running list to synchronize on
260 * 261 *
261 * This function waits until all asynchronous function calls for the running 262 * This function waits until all asynchronous function calls for the
262 * list @list have been done. 263 * synchronization domain specified by the running list @list have been done.
263 */ 264 */
264void async_synchronize_full_special(struct list_head *list) 265void async_synchronize_full_domain(struct list_head *list)
265{ 266{
266 async_synchronize_cookie_special(next_cookie, list); 267 async_synchronize_cookie_domain(next_cookie, list);
267} 268}
268EXPORT_SYMBOL_GPL(async_synchronize_full_special); 269EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
269 270
270/** 271/**
271 * async_synchronize_cookie_special - synchronize asynchronous function calls on a running list with cookie checkpointing 272 * async_synchronize_cookie_domain - synchronize asynchronous function calls within a certain domain with cookie checkpointing
272 * @cookie: async_cookie_t to use as checkpoint 273 * @cookie: async_cookie_t to use as checkpoint
273 * @running: running list to synchronize on 274 * @running: running list to synchronize on
274 * 275 *
275 * This function waits until all asynchronous function calls for the running 276 * This function waits until all asynchronous function calls for the
276 * list @list submitted prior to @cookie have been done. 277 * synchronization domain specified by the running list @list submitted
278 * prior to @cookie have been done.
277 */ 279 */
278void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *running) 280void async_synchronize_cookie_domain(async_cookie_t cookie,
281 struct list_head *running)
279{ 282{
280 ktime_t starttime, delta, endtime; 283 ktime_t starttime, delta, endtime;
281 284
@@ -295,7 +298,7 @@ void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *r
295 (long long)ktime_to_ns(delta) >> 10); 298 (long long)ktime_to_ns(delta) >> 10);
296 } 299 }
297} 300}
298EXPORT_SYMBOL_GPL(async_synchronize_cookie_special); 301EXPORT_SYMBOL_GPL(async_synchronize_cookie_domain);
299 302
300/** 303/**
301 * async_synchronize_cookie - synchronize asynchronous function calls with cookie checkpointing 304 * async_synchronize_cookie - synchronize asynchronous function calls with cookie checkpointing
@@ -306,7 +309,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_cookie_special);
306 */ 309 */
307void async_synchronize_cookie(async_cookie_t cookie) 310void async_synchronize_cookie(async_cookie_t cookie)
308{ 311{
309 async_synchronize_cookie_special(cookie, &async_running); 312 async_synchronize_cookie_domain(cookie, &async_running);
310} 313}
311EXPORT_SYMBOL_GPL(async_synchronize_cookie); 314EXPORT_SYMBOL_GPL(async_synchronize_cookie);
312 315