lkml.org 
[lkml]   [2000]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug in scsi.c
On Thu, 7 Dec 2000, Andreas Klein wrote:
> > A proper way to release the references to resources is to call daemonize()
> > function from within the kernel thread function, which calls
> > exit_fs()/exit_files() internally.
>
> Nearly correct, the daemonize function does NOT call exit_files.

I do not post messages to linux-kernel without checking the facts
first. Read the daemonize() function and see for yourself that you are
wrong.

Regards,
Tigran

PS, Here it is, to save you time opening kernel/sched.c. The kernel is, of
course, test12-pre7.

/*
* Put all the gunge required to become a kernel thread without
* attached user resources in one place where it belongs.
*/

void daemonize(void)
{
struct fs_struct *fs;


/*
* If we were started as result of loading a module, close all of
the
* user space pages. We don't need them, and if we didn't close
them
* they would be locked into memory.
*/
exit_mm(current);

current->session = 1;
current->pgrp = 1;

/* Become as one with the init task */

exit_fs(current); /* current->fs->count--; */
fs = init_task.fs;
current->fs = fs;
atomic_inc(&fs->count);
exit_files(current);
current->files = init_task.files;
atomic_inc(&current->files->count);
}


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

\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.028 / U:4.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site