new helper: daemonize_descriptors()
descriptor-related parts of daemonize, done right. As the
result we simplify the locking rules for ->files - we
hold task_lock in *all* cases when we modify ->files.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/kernel/exit.c b/kernel/exit.c
index 20dfc76..0951133 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -457,9 +457,7 @@
/* Become as one with the init task */
daemonize_fs_struct();
- exit_files(current);
- current->files = init_task.files;
- atomic_inc(¤t->files->count);
+ daemonize_descriptors();
reparent_to_kthreadd();
}