diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:32:26 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:32:26 -0500 |
| commit | 9a100a4464917b5ffff3a8ce1c2758088fd9bb32 (patch) | |
| tree | 2c0e42dd23907dbdff147fa0097ccc2ef7be9ae1 | |
| parent | 0d34052dfeba307ebc18d2f672e80e3f419714d4 (diff) | |
| parent | cdb80f630be5cbc23d82331f24dc4704f75b64f4 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async-2
* git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async-2:
async: make async a command line option for now
partial revert of asynchronous inode delete
| -rw-r--r-- | fs/inode.c | 19 | ||||
| -rw-r--r-- | kernel/async.c | 16 |
2 files changed, 21 insertions, 14 deletions
diff --git a/fs/inode.c b/fs/inode.c index 0013ac1af8e..913ab2d9a5d 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -1139,11 +1139,16 @@ EXPORT_SYMBOL(remove_inode_hash); | |||
| 1139 | * I_FREEING is set so that no-one will take a new reference to the inode while | 1139 | * I_FREEING is set so that no-one will take a new reference to the inode while |
| 1140 | * it is being deleted. | 1140 | * it is being deleted. |
| 1141 | */ | 1141 | */ |
| 1142 | static void generic_delete_inode_async(void *data, async_cookie_t cookie) | 1142 | void generic_delete_inode(struct inode *inode) |
| 1143 | { | 1143 | { |
| 1144 | struct inode *inode = data; | ||
| 1145 | const struct super_operations *op = inode->i_sb->s_op; | 1144 | const struct super_operations *op = inode->i_sb->s_op; |
| 1146 | 1145 | ||
| 1146 | list_del_init(&inode->i_list); | ||
| 1147 | list_del_init(&inode->i_sb_list); | ||
| 1148 | inode->i_state |= I_FREEING; | ||
| 1149 | inodes_stat.nr_inodes--; | ||
| 1150 | spin_unlock(&inode_lock); | ||
| 1151 | |||
| 1147 | security_inode_delete(inode); | 1152 | security_inode_delete(inode); |
| 1148 | 1153 | ||
| 1149 | if (op->delete_inode) { | 1154 | if (op->delete_inode) { |
| @@ -1167,16 +1172,6 @@ static void generic_delete_inode_async(void *data, async_cookie_t cookie) | |||
| 1167 | destroy_inode(inode); | 1172 | destroy_inode(inode); |
| 1168 | } | 1173 | } |
| 1169 | 1174 | ||
| 1170 | void generic_delete_inode(struct inode *inode) | ||
| 1171 | { | ||
| 1172 | list_del_init(&inode->i_list); | ||
| 1173 | list_del_init(&inode->i_sb_list); | ||
| 1174 | inode->i_state |= I_FREEING; | ||
| 1175 | inodes_stat.nr_inodes--; | ||
| 1176 | spin_unlock(&inode_lock); | ||
| 1177 | async_schedule_special(generic_delete_inode_async, inode, &inode->i_sb->s_async_list); | ||
| 1178 | } | ||
| 1179 | |||
| 1180 | EXPORT_SYMBOL(generic_delete_inode); | 1175 | EXPORT_SYMBOL(generic_delete_inode); |
| 1181 | 1176 | ||
| 1182 | static void generic_forget_inode(struct inode *inode) | 1177 | static void generic_forget_inode(struct inode *inode) |
diff --git a/kernel/async.c b/kernel/async.c index 64cc916299a..f286e9f2b73 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
| @@ -65,6 +65,8 @@ static LIST_HEAD(async_pending); | |||
| 65 | static LIST_HEAD(async_running); | 65 | static LIST_HEAD(async_running); |
| 66 | static DEFINE_SPINLOCK(async_lock); | 66 | static DEFINE_SPINLOCK(async_lock); |
| 67 | 67 | ||
| 68 | static int async_enabled = 0; | ||
| 69 | |||
| 68 | struct async_entry { | 70 | struct async_entry { |
| 69 | struct list_head list; | 71 | struct list_head list; |
| 70 | async_cookie_t cookie; | 72 | async_cookie_t cookie; |
| @@ -169,7 +171,7 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct l | |||
| 169 | * If we're out of memory or if there's too much work | 171 | * If we're out of memory or if there's too much work |
| 170 | * pending already, we execute synchronously. | 172 | * pending already, we execute synchronously. |
| 171 | */ | 173 | */ |
| 172 | if (!entry || atomic_read(&entry_count) > MAX_WORK) { | 174 | if (!async_enabled || !entry || atomic_read(&entry_count) > MAX_WORK) { |
| 173 | kfree(entry); | 175 | kfree(entry); |
| 174 | spin_lock_irqsave(&async_lock, flags); | 176 | spin_lock_irqsave(&async_lock, flags); |
| 175 | newcookie = next_cookie++; | 177 | newcookie = next_cookie++; |
| @@ -316,8 +318,18 @@ static int async_manager_thread(void *unused) | |||
| 316 | 318 | ||
| 317 | static int __init async_init(void) | 319 | static int __init async_init(void) |
| 318 | { | 320 | { |
| 319 | kthread_run(async_manager_thread, NULL, "async/mgr"); | 321 | if (async_enabled) |
| 322 | kthread_run(async_manager_thread, NULL, "async/mgr"); | ||
| 320 | return 0; | 323 | return 0; |
| 321 | } | 324 | } |
| 322 | 325 | ||
| 326 | static int __init setup_async(char *str) | ||
| 327 | { | ||
| 328 | async_enabled = 1; | ||
| 329 | return 1; | ||
| 330 | } | ||
| 331 | |||
| 332 | __setup("fastboot", setup_async); | ||
| 333 | |||
| 334 | |||
| 323 | core_initcall(async_init); | 335 | core_initcall(async_init); |
