patch-2.4.0-test5 linux/kernel/fork.c
Next file: linux/kernel/kmod.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index
- Lines: 74
- Date:
Thu Jul 27 16:47:16 2000
- Orig file:
v2.4.0-test4/linux/kernel/fork.c
- Orig date:
Mon Jul 10 16:47:27 2000
diff -u --recursive --new-file v2.4.0-test4/linux/kernel/fork.c linux/kernel/fork.c
@@ -35,9 +35,6 @@
/* SLAB cache for mm_struct's. */
kmem_cache_t *mm_cachep;
-/* SLAB cache for files structs */
-kmem_cache_t *files_cachep;
-
struct task_struct *pidhash[PIDHASH_SZ];
/* UID task count cache, to prevent walking entire process list every
@@ -159,6 +156,33 @@
return 0;
}
+void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+{
+ unsigned long flags;
+
+ wq_write_lock_irqsave(&q->lock, flags);
+ __add_wait_queue(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
+void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)
+{
+ unsigned long flags;
+
+ wq_write_lock_irqsave(&q->lock, flags);
+ __add_wait_queue_tail(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
+void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+{
+ unsigned long flags;
+
+ wq_write_lock_irqsave(&q->lock, flags);
+ __remove_wait_queue(q, wait);
+ wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
void __init fork_init(unsigned long mempages)
{
int i;
@@ -666,13 +690,6 @@
copy_flags(clone_flags, p);
p->pid = get_pid(clone_flags);
- /*
- * This is a "shadow run" state. The process
- * is marked runnable, but isn't actually on
- * any run queue yet.. (that happens at the
- * very end).
- */
- p->state = TASK_RUNNING;
p->run_list.next = NULL;
p->run_list.prev = NULL;
@@ -789,15 +806,4 @@
bad_fork_free:
free_task_struct(p);
goto bad_fork;
-}
-
-void __init filescache_init(void)
-{
- files_cachep = kmem_cache_create("files_cache",
- sizeof(struct files_struct),
- 0,
- SLAB_HWCACHE_ALIGN,
- NULL, NULL);
- if (!files_cachep)
- panic("Cannot create files cache");
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)