diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-24 01:56:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-22 15:57:58 -0400 |
commit | 4a9d4b024a3102fc083c925c242d98ac27b1c5f6 (patch) | |
tree | 1a4e9d1e86a2c1b70f8352c13da8a7eee97bc5f1 /init | |
parent | a2d4c71d1559426155e5da8db3265bfa0d8d398d (diff) |
switch fput to task_work_add
... and schedule_work() for interrupt/kernel_thread callers
(and yes, now it *is* OK to call from interrupt).
We are guaranteed that __fput() will be done before we return
to userland (or exit). Note that for fput() from a kernel
thread we get an async behaviour; it's almost always OK, but
sometimes you might need to have __fput() completed before
you do anything else. There are two mechanisms for that -
a general barrier (flush_delayed_fput()) and explicit
__fput_sync(). Both should be used with care (as was the
case for fput() from kernel threads all along). See comments
in fs/file_table.c for details.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c index b5cc0a7c4708..3f151f6c6da7 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #include <linux/shmem_fs.h> | 68 | #include <linux/shmem_fs.h> |
69 | #include <linux/slab.h> | 69 | #include <linux/slab.h> |
70 | #include <linux/perf_event.h> | 70 | #include <linux/perf_event.h> |
71 | #include <linux/file.h> | ||
71 | 72 | ||
72 | #include <asm/io.h> | 73 | #include <asm/io.h> |
73 | #include <asm/bugs.h> | 74 | #include <asm/bugs.h> |
@@ -804,8 +805,8 @@ static noinline int init_post(void) | |||
804 | system_state = SYSTEM_RUNNING; | 805 | system_state = SYSTEM_RUNNING; |
805 | numa_default_policy(); | 806 | numa_default_policy(); |
806 | 807 | ||
807 | |||
808 | current->signal->flags |= SIGNAL_UNKILLABLE; | 808 | current->signal->flags |= SIGNAL_UNKILLABLE; |
809 | flush_delayed_fput(); | ||
809 | 810 | ||
810 | if (ramdisk_execute_command) { | 811 | if (ramdisk_execute_command) { |
811 | run_init_process(ramdisk_execute_command); | 812 | run_init_process(ramdisk_execute_command); |