diff options
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index cd4d87a82951..485dc0eddd67 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -306,17 +306,18 @@ void fput(struct file *file) | |||
306 | { | 306 | { |
307 | if (atomic_long_dec_and_test(&file->f_count)) { | 307 | if (atomic_long_dec_and_test(&file->f_count)) { |
308 | struct task_struct *task = current; | 308 | struct task_struct *task = current; |
309 | unsigned long flags; | ||
310 | |||
309 | file_sb_list_del(file); | 311 | file_sb_list_del(file); |
310 | if (unlikely(in_interrupt() || task->flags & PF_KTHREAD)) { | 312 | if (likely(!in_interrupt() && !(task->flags & PF_KTHREAD))) { |
311 | unsigned long flags; | 313 | init_task_work(&file->f_u.fu_rcuhead, ____fput); |
312 | spin_lock_irqsave(&delayed_fput_lock, flags); | 314 | if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) |
313 | list_add(&file->f_u.fu_list, &delayed_fput_list); | 315 | return; |
314 | schedule_work(&delayed_fput_work); | ||
315 | spin_unlock_irqrestore(&delayed_fput_lock, flags); | ||
316 | return; | ||
317 | } | 316 | } |
318 | init_task_work(&file->f_u.fu_rcuhead, ____fput); | 317 | spin_lock_irqsave(&delayed_fput_lock, flags); |
319 | task_work_add(task, &file->f_u.fu_rcuhead, true); | 318 | list_add(&file->f_u.fu_list, &delayed_fput_list); |
319 | schedule_work(&delayed_fput_work); | ||
320 | spin_unlock_irqrestore(&delayed_fput_lock, flags); | ||
320 | } | 321 | } |
321 | } | 322 | } |
322 | 323 | ||