]> Git Repo - linux.git/commitdiff
[PATCH] Move pidmap to pspace.h
authorSukadev Bhattiprolu <[email protected]>
Mon, 2 Oct 2006 09:17:23 +0000 (02:17 -0700)
committerLinus Torvalds <[email protected]>
Mon, 2 Oct 2006 14:57:15 +0000 (07:57 -0700)
Move struct pidmap and PIDMAP_ENTRIES to a new file, include/linux/pspace.h
where it will be used in subsequent patches to define pid spaces.

Its a subset of Eric Biederman's patch http://lkml.org/lkml/2006/2/6/285

[[email protected]: cleanups]
Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: Cedric Le Goater <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/pspace.h [new file with mode: 0644]
kernel/pid.c

diff --git a/include/linux/pspace.h b/include/linux/pspace.h
new file mode 100644 (file)
index 0000000..a8a064b
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _LINUX_PSPACE_H
+#define _LINUX_PSPACE_H
+
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/threads.h>
+#include <linux/pid.h>
+
+struct pidmap {
+       atomic_t nr_free;
+       void *page;
+};
+
+#define PIDMAP_ENTRIES         ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
+
+#endif /* _LINUX_PSPACE_H */
index 373639a10d8456dce5998d8c6f949569edb1abcb..8234bd08a3cb32d44a12f3efe865830443fa86b6 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/hash.h>
+#include <linux/pspace.h>
 
 #define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift)
 static struct hlist_head *pid_hash;
@@ -40,7 +41,6 @@ int last_pid;
 int pid_max_min = RESERVED_PIDS + 1;
 int pid_max_max = PID_MAX_LIMIT;
 
-#define PIDMAP_ENTRIES         ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
 #define BITS_PER_PAGE          (PAGE_SIZE*8)
 #define BITS_PER_PAGE_MASK     (BITS_PER_PAGE-1)
 #define mk_pid(map, off)       (((map) - pidmap_array)*BITS_PER_PAGE + (off))
@@ -53,11 +53,6 @@ int pid_max_max = PID_MAX_LIMIT;
  * value does not cause lots of bitmaps to be allocated, but
  * the scheme scales to up to 4 million PIDs, runtime.
  */
-struct pidmap {
-       atomic_t nr_free;
-       void *page;
-};
-
 static struct pidmap pidmap_array[PIDMAP_ENTRIES] =
         { [ 0 ... PIDMAP_ENTRIES-1 ] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } };
 
This page took 0.048149 seconds and 4 git commands to generate.