]> git.hungrycats.org Git - linux/commitdiff
[PATCH] (1/5) sane procfs/dcache interaction
authorAlexander Viro <viro@math.psu.edu>
Mon, 22 Apr 2002 06:03:18 +0000 (23:03 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 22 Apr 2002 06:03:18 +0000 (23:03 -0700)
 - take unhash_process() into sched.c, move zeroing ->pid into it (and
   under tasklist_lock)

include/linux/sched.h
kernel/exit.c

index f5fd7b435bd1be30bf5b0294a084a2fe06ae1449..8f0df64bb7231b0ae32bfbb66ec574a9d3a18c4d 100644 (file)
@@ -769,15 +769,7 @@ static inline struct task_struct *younger_sibling(struct task_struct *p)
 
 #define thread_group_leader(p) (p->pid == p->tgid)
 
-static inline void unhash_process(struct task_struct *p)
-{
-       write_lock_irq(&tasklist_lock);
-       nr_threads--;
-       unhash_pid(p);
-       REMOVE_LINKS(p);
-       list_del(&p->thread_group);
-       write_unlock_irq(&tasklist_lock);
-}
+extern void unhash_process(struct task_struct *p);
 
 /* Protects ->fs, ->files, ->mm, and synchronises with wait4().  Nests inside tasklist_lock */
 static inline void task_lock(struct task_struct *p)
index feb2470a602468b85d46c19e33bd39f818385f31..58b05e3ef9f8294852c81e4908f030d6f076403e 100644 (file)
@@ -27,6 +27,17 @@ extern struct task_struct *child_reaper;
 
 int getrusage(struct task_struct *, int, struct rusage *);
 
+static inline void __unhash_process(struct task_struct *p)
+{
+       write_lock_irq(&tasklist_lock);
+       nr_threads--;
+       unhash_pid(p);
+       REMOVE_LINKS(p);
+       list_del(&p->thread_group);
+       p->pid = 0;
+       write_unlock_irq(&tasklist_lock);
+}
+
 static void release_task(struct task_struct * p)
 {
        if (p == current)
@@ -43,10 +54,16 @@ static void release_task(struct task_struct * p)
        current->cmaj_flt += p->maj_flt + p->cmaj_flt;
        current->cnswap += p->nswap + p->cnswap;
        sched_exit(p);
-       p->pid = 0;
        put_task_struct(p);
 }
 
+/* we are using it only for SMP init */
+
+void unhash_process(struct task_struct *p)
+{
+       return __unhash_process(p);
+}
+
 /*
  * This checks not only the pgrp, but falls back on the pid if no
  * satisfactory pgrp is found. I dunno - gdb doesn't work correctly