Commit 1350c3f2 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] daemonize() calls reparent_to_init cleanup

 This makes daemonize() call reparent_to_init() itself, as long
suggested for 2.5, and fixes the callers so they don't call it again.
Also fixes callers which set current->tty to NULL themselves (also
no longer neccessary).
parent 3c14138b
......@@ -232,7 +232,6 @@ int khvcd(void *unused)
int i;
daemonize();
reparent_to_init();
strcpy(current->comm, "khvcd");
sigfillset(&current->blocked);
......
......@@ -1025,7 +1025,6 @@ static int hpc_poll_thread (void *data)
debug ("%s - Entry\n", __FUNCTION__);
lock_kernel ();
daemonize ();
reparent_to_init ();
// New name
strcpy (current->comm, "hpc_poll");
......
......@@ -2486,7 +2486,6 @@ int md_thread(void * arg)
*/
daemonize();
reparent_to_init();
sprintf(current->comm, thread->name);
current->exit_signal = SIGCHLD;
......
......@@ -304,7 +304,6 @@ static int write_queue_task(void *data)
DEBUG(1, "blkmtd: writetask: starting (pid = %d)\n", tsk->pid);
daemonize();
strcpy(tsk->comm, "blkmtdd");
tsk->tty = NULL;
spin_lock_irq(&tsk->sigmask_lock);
sigfillset(&tsk->blocked);
recalc_sigpending();
......
......@@ -1582,8 +1582,7 @@ static int rtl8139_thread (void *data)
struct rtl8139_private *tp = dev->priv;
unsigned long timeout;
daemonize ();
reparent_to_init();
daemonize();
spin_lock_irq(&current->sigmask_lock);
sigemptyset(&current->blocked);
recalc_sigpending();
......
......@@ -616,7 +616,6 @@ static int pnp_dock_thread(void * unused)
static struct pnp_docking_station_info now;
int docked = -1, d = 0;
daemonize();
reparent_to_init();
strcpy(current->comm, "kpnpbiosd");
while(!unloading && !signal_pending(current))
{
......
......@@ -1878,7 +1878,6 @@ void scsi_error_handler(void *data)
*/
daemonize();
reparent_to_init();
/*
* Set the name of this process.
......
......@@ -309,7 +309,6 @@ static int usb_stor_control_thread(void * __us)
* so get rid of all our resources..
*/
daemonize();
reparent_to_init();
/* avoid getting signals */
spin_lock_irq(&current->sigmask_lock);
......
......@@ -83,7 +83,6 @@ static int jffs2_garbage_collect_thread(void *_c)
struct jffs2_sb_info *c = _c;
daemonize();
current->tty = NULL;
c->gc_task = current;
up(&c->gc_thread_start);
......
......@@ -2114,7 +2114,6 @@ int jfsIOWait(void *arg)
lock_kernel();
daemonize();
current->tty = NULL;
strcpy(current->comm, "jfsIO");
unlock_kernel();
......
......@@ -2763,7 +2763,6 @@ int jfs_lazycommit(void *arg)
lock_kernel();
daemonize();
current->tty = NULL;
strcpy(current->comm, "jfsCommit");
unlock_kernel();
......@@ -2961,7 +2960,6 @@ int jfs_sync(void *arg)
lock_kernel();
daemonize();
current->tty = NULL;
strcpy(current->comm, "jfsSync");
unlock_kernel();
......
......@@ -202,7 +202,6 @@ reclaimer(void *ptr)
struct inode *inode;
daemonize();
reparent_to_init();
snprintf(current->comm, sizeof(current->comm),
"%s-reclaim",
host->h_name);
......
......@@ -98,7 +98,6 @@ lockd(struct svc_rqst *rqstp)
up(&lockd_start);
daemonize();
reparent_to_init();
sprintf(current->comm, "lockd");
/* Process request with signals blocked. */
......
......@@ -232,6 +232,8 @@ void daemonize(void)
exit_files(current);
current->files = init_task.files;
atomic_inc(&current->files->count);
reparent_to_init();
}
static void reparent_thread(task_t *p, task_t *reaper, task_t *child_reaper)
......
......@@ -524,7 +524,6 @@ EXPORT_SYMBOL(secure_tcp_sequence_number);
EXPORT_SYMBOL(get_random_bytes);
EXPORT_SYMBOL(securebits);
EXPORT_SYMBOL(cap_bset);
EXPORT_SYMBOL(reparent_to_init);
EXPORT_SYMBOL(daemonize);
EXPORT_SYMBOL(csum_partial); /* for networking and md */
EXPORT_SYMBOL(seq_escape);
......
......@@ -88,7 +88,6 @@ struct pdflush_work {
static int __pdflush(struct pdflush_work *my_work)
{
daemonize();
reparent_to_init();
strcpy(current->comm, "pdflush");
/* interruptible sleep, so block all signals */
......
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