clockevents: check broadcast tick device not the clock events device
[pandora-kernel.git] / kernel / acct.c
index 7fc9f9d..dd68b90 100644 (file)
@@ -631,15 +631,9 @@ void acct_collect(long exitcode, int group_dead)
        spin_unlock_irq(&current->sighand->siglock);
 }
 
-/**
- * acct_process - now just a wrapper around do_acct_process
- *
- * handles process accounting for an exiting task
- */
-void acct_process(void)
+static void acct_process_in_ns(struct pid_namespace *ns)
 {
        struct file *file = NULL;
-       struct pid_namespace *ns = task_active_pid_ns(current);
        struct bsd_acct_struct *acct;
 
        acct = ns->bacct;
@@ -661,3 +655,22 @@ void acct_process(void)
        do_acct_process(acct, ns, file);
        fput(file);
 }
+
+/**
+ * acct_process - now just a wrapper around acct_process_in_ns,
+ * which in turn is a wrapper around do_acct_process.
+ *
+ * handles process accounting for an exiting task
+ */
+void acct_process(void)
+{
+       struct pid_namespace *ns;
+
+       /*
+        * This loop is safe lockless, since current is still
+        * alive and holds its namespace, which in turn holds
+        * its parent.
+        */
+       for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
+               acct_process_in_ns(ns);
+}