kernel: rename is_single_threaded(task) to current_is_single_threaded(void)

- is_single_threaded(task) is not safe unless task == current,
  we can't use task->signal or task->mm.

- it doesn't make sense unless task == current, the task can
  fork right after the check.

Rename it to current_is_single_threaded() and kill the argument.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
这个提交包含在:
Oleg Nesterov
2009-07-10 03:48:23 +02:00
提交者 James Morris
父节点 d2e3ee9b29
当前提交 5bb459bb45
修改 4 个文件,包含 5 行新增4 行删除

查看文件

@@ -702,7 +702,7 @@ long join_session_keyring(const char *name)
/* only permit this if there's a single thread in the thread group -
* this avoids us having to adjust the creds on all threads and risking
* ENOMEM */
if (!is_single_threaded(current))
if (!current_is_single_threaded())
return -EMLINK;
new = prepare_creds();