]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/exit.c
[PATCH] smc91x: allow for dynamic bus access configs
[linux-2.6-omap-h63xx.git] / kernel / exit.c
index f8e609ff1893f2d85f76f4b56cba97135b97d152..d1e8d500a7e127cb2915da8e2da4beab942c6e99 100644 (file)
@@ -193,7 +193,7 @@ int is_orphaned_pgrp(int pgrp)
        return retval;
 }
 
-static inline int has_stopped_jobs(int pgrp)
+static int has_stopped_jobs(int pgrp)
 {
        int retval = 0;
        struct task_struct *p;
@@ -230,7 +230,7 @@ static inline int has_stopped_jobs(int pgrp)
  *
  * NOTE that reparent_to_init() gives the caller full capabilities.
  */
-static inline void reparent_to_init(void)
+static void reparent_to_init(void)
 {
        write_lock_irq(&tasklist_lock);
 
@@ -244,7 +244,9 @@ static inline void reparent_to_init(void)
        /* Set the exit signal to SIGCHLD so we signal init on exit */
        current->exit_signal = SIGCHLD;
 
-       if ((current->policy == SCHED_NORMAL) && (task_nice(current) < 0))
+       if ((current->policy == SCHED_NORMAL ||
+                       current->policy == SCHED_BATCH)
+                               && (task_nice(current) < 0))
                set_user_nice(current, 0);
        /* cpus_allowed? */
        /* rt_priority? */
@@ -358,6 +360,9 @@ void daemonize(const char *name, ...)
        fs = init_task.fs;
        current->fs = fs;
        atomic_inc(&fs->count);
+       exit_namespace(current);
+       current->namespace = init_task.namespace;
+       get_namespace(current->namespace);
        exit_files(current);
        current->files = init_task.files;
        atomic_inc(&current->files->count);
@@ -367,7 +372,7 @@ void daemonize(const char *name, ...)
 
 EXPORT_SYMBOL(daemonize);
 
-static inline void close_files(struct files_struct * files)
+static void close_files(struct files_struct * files)
 {
        int i, j;
        struct fdtable *fdt;
@@ -541,7 +546,7 @@ static inline void choose_new_parent(task_t *p, task_t *reaper, task_t *child_re
        p->real_parent = reaper;
 }
 
-static inline void reparent_thread(task_t *p, task_t *father, int traced)
+static void reparent_thread(task_t *p, task_t *father, int traced)
 {
        /* We don't want people slaying init.  */
        if (p->exit_signal != -1)
@@ -605,7 +610,7 @@ static inline void reparent_thread(task_t *p, task_t *father, int traced)
  * group, and if no such member exists, give it to
  * the global child reaper process (ie "init")
  */
-static inline void forget_original_parent(struct task_struct * father,
+static void forget_original_parent(struct task_struct * father,
                                          struct list_head *to_release)
 {
        struct task_struct *p, *reaper = father;
@@ -802,8 +807,6 @@ fastcall NORET_TYPE void do_exit(long code)
                panic("Attempted to kill the idle task!");
        if (unlikely(tsk->pid == 1))
                panic("Attempted to kill init!");
-       if (tsk->io_context)
-               exit_io_context();
 
        if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
                current->ptrace_message = code;
@@ -817,6 +820,8 @@ fastcall NORET_TYPE void do_exit(long code)
        if (unlikely(tsk->flags & PF_EXITING)) {
                printk(KERN_ALERT
                        "Fixing recursive fault but reboot is needed!\n");
+               if (tsk->io_context)
+                       exit_io_context();
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule();
        }
@@ -876,6 +881,9 @@ fastcall NORET_TYPE void do_exit(long code)
         */
        mutex_debug_check_no_locks_held(tsk);
 
+       if (tsk->io_context)
+               exit_io_context();
+
        /* PF_DEAD causes final put_task_struct after we schedule. */
        preempt_disable();
        BUG_ON(tsk->flags & PF_DEAD);