summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRaphael S.Carvalho <raphael.scarv@gmail.com>2013-05-01 00:28:27 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 02:04:07 +0200
commit5cc5445164c16d32bab2912fac28356ab07aa8b4 (patch)
tree63ecdef695220d172d1e487a8c94ac6d7a3bab25 /include
parentkernel/pid.c: improve flow of a loop inside alloc_pidmap. (diff)
downloadlinux-5cc5445164c16d32bab2912fac28356ab07aa8b4.tar.xz
linux-5cc5445164c16d32bab2912fac28356ab07aa8b4.zip
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: Raphael S.Carvalho <raphael.scarv@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pid_namespace.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 215e5e3dda10..8ac32836690e 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -13,7 +13,9 @@ struct pidmap {
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;