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>
这个提交包含在:
Al Viro
2012-08-22 18:42:10 -04:00
父节点 2be7fd55d4
当前提交 864bdb3b6c
修改 3 个文件,包含 8 行新增3 行删除

查看文件

@@ -457,9 +457,7 @@ void daemonize(const char *name, ...)
/* Become as one with the init task */
daemonize_fs_struct();
exit_files(current);
current->files = init_task.files;
atomic_inc(&current->files->count);
daemonize_descriptors();
reparent_to_kthreadd();
}