Commit 5cc54451 authored by Raphael S.Carvalho's avatar Raphael S.Carvalho Committed by Linus Torvalds

pid_namespace.c/.h: simplify defines

Move BITS_PER_PAGE from pid_namespace.c to pid_namespace.h, since we can
simplify the define PID_MAP_ENTRIES by using the BITS_PER_PAGE.

[akpm@linux-foundation.org: kernel/pid.c:54:1: warning: "BITS_PER_PAGE" redefined]
Signed-off-by: default avatarRaphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8db049b3
...@@ -13,7 +13,9 @@ struct pidmap { ...@@ -13,7 +13,9 @@ struct pidmap {
void *page; void *page;
}; };
#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 PIDMAP_ENTRIES ((PID_MAX_LIMIT+BITS_PER_PAGE-1)/BITS_PER_PAGE)
struct bsd_acct_struct; struct bsd_acct_struct;
......
...@@ -51,9 +51,6 @@ int pid_max = PID_MAX_DEFAULT; ...@@ -51,9 +51,6 @@ int pid_max = PID_MAX_DEFAULT;
int pid_max_min = RESERVED_PIDS + 1; int pid_max_min = RESERVED_PIDS + 1;
int pid_max_max = PID_MAX_LIMIT; int pid_max_max = PID_MAX_LIMIT;
#define BITS_PER_PAGE (PAGE_SIZE*8)
#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1)
static inline int mk_pid(struct pid_namespace *pid_ns, static inline int mk_pid(struct pid_namespace *pid_ns,
struct pidmap *map, int off) struct pidmap *map, int off)
{ {
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/export.h> #include <linux/export.h>
#define BITS_PER_PAGE (PAGE_SIZE*8)
struct pid_cache { struct pid_cache {
int nr_ids; int nr_ids;
char name[16]; char name[16];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment