Commit 36772092 authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds

[PATCH] comments on locking of task->comm

Add some comments about task->comm, to explain what it is near its definition
and provide some important pointers to its uses.
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 291c4a75
...@@ -869,9 +869,11 @@ int flush_old_exec(struct linux_binprm * bprm) ...@@ -869,9 +869,11 @@ int flush_old_exec(struct linux_binprm * bprm)
if (current->euid == current->uid && current->egid == current->gid) if (current->euid == current->uid && current->egid == current->gid)
current->mm->dumpable = 1; current->mm->dumpable = 1;
name = bprm->filename; name = bprm->filename;
/* Copies the binary name from after last slash */
for (i=0; (ch = *(name++)) != '\0';) { for (i=0; (ch = *(name++)) != '\0';) {
if (ch == '/') if (ch == '/')
i = 0; i = 0; /* overwrite what we wrote */
else else
if (i < (sizeof(tcomm) - 1)) if (i < (sizeof(tcomm) - 1))
tcomm[i++] = ch; tcomm[i++] = ch;
......
...@@ -578,7 +578,7 @@ struct task_struct { ...@@ -578,7 +578,7 @@ struct task_struct {
unsigned long flags; /* per process flags, defined below */ unsigned long flags; /* per process flags, defined below */
unsigned long ptrace; unsigned long ptrace;
int lock_depth; /* Lock depth */ int lock_depth; /* BKL lock depth */
int prio, static_prio; int prio, static_prio;
struct list_head run_list; struct list_head run_list;
...@@ -661,7 +661,10 @@ struct task_struct { ...@@ -661,7 +661,10 @@ struct task_struct {
struct key *thread_keyring; /* keyring private to this thread */ struct key *thread_keyring; /* keyring private to this thread */
#endif #endif
int oomkilladj; /* OOM kill score adjustment (bit shift). */ int oomkilladj; /* OOM kill score adjustment (bit shift). */
char comm[TASK_COMM_LEN]; char comm[TASK_COMM_LEN]; /* executable name excluding path
- access with [gs]et_task_comm (which lock
it with task_lock())
- initialized normally by flush_old_exec */
/* file system info */ /* file system info */
int link_count, total_link_count; int link_count, total_link_count;
/* ipc stuff */ /* ipc stuff */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment