2.4.23 *_task_struct() observations ...

From: Herbert Poetzl
Date: Mon Dec 01 2003 - 12:27:10 EST

Hi All!

just wanted to get an opinion on the following ...

include/asm-i386/processor.h defines ...

#define alloc_task_struct() ((struct task_struct *) \
#define free_task_struct(p) free_pages((unsigned long) (p), 1)
#define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count)

now there seems to be no put_task_struct(), but
there are some examples where get/free is used
where I would expect a put_* ...

fs/proc/base.c for example does:

task = find_task_by_pid(pid);
if (task)
if (!task)
goto out;

inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_INO);


which is a little suspicious ...

please could anybody explain the logic behind that?
(if it isn't a widespread bug(tm))


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/