summaryrefslogtreecommitdiffstats
path: root/src/common/page.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/page.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/page.cc b/src/common/page.cc
new file mode 100644
index 00000000..7a252a60
--- /dev/null
+++ b/src/common/page.cc
@@ -0,0 +1,19 @@
+#include <unistd.h>
+
+namespace ceph {
+
+ // page size crap, see page.h
+ int _get_bits_of(int v) {
+ int n = 0;
+ while (v) {
+ n++;
+ v = v >> 1;
+ }
+ return n;
+ }
+
+ unsigned _page_size = sysconf(_SC_PAGESIZE);
+ unsigned long _page_mask = ~(unsigned long)(_page_size - 1);
+ unsigned _page_shift = _get_bits_of(_page_size - 1);
+
+}