Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Mon, 27 Aug 2007 10:02:19 +0000 (10:02 +0000)
committeryangsheng <yangsheng>
Mon, 27 Aug 2007 10:02:19 +0000 (10:02 +0000)
b=13360
i=isaac
i=liangzhen

Add PAGE_SIZE when it undef.

lnet/include/libcfs/user-prim.h
lustre/ChangeLog

index 54f7832..d182041 100644 (file)
 #include <libcfs/user-time.h>
 #include <signal.h>
 #include <stdlib.h>
 #include <libcfs/user-time.h>
 #include <signal.h>
 #include <stdlib.h>
+#include <unistd.h>
+
+#ifndef PAGE_SIZE
+
+#define PAGE_SIZE (getpagesize())
+static __inline__ int getpageshift()
+{
+        int pagesize = getpagesize();
+#if (__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+        /* unsigned int is 32 bits on all our architectures */
+        return (__builtin_clz(pagesize) ^ 31);
+#else
+        register int pageshift = -1;
+        while (pagesize) { pagesize >>= 1; pageshift++; }
+        return pageshift;
+#endif
+}
+
+#undef  PAGE_MASK
+#define PAGE_MASK  (~(PAGE_SIZE-1))
+#undef  PAGE_SHIFT
+#define PAGE_SHIFT (getpageshift())
+
+#endif
 
 /*
  * Wait Queue. No-op implementation.
 
 /*
  * Wait Queue. No-op implementation.
index 51912f6..56e9438 100644 (file)
@@ -168,6 +168,11 @@ Bugzilla   : 13039
 Description: RedHat Update kernel for RHEL5
 Details    : Modify the kernel config file more closer RHEL5.
 
 Description: RedHat Update kernel for RHEL5
 Details    : Modify the kernel config file more closer RHEL5.
 
+Severity   : normal
+Bugzilla   : 13360
+Description: Build failure against Centos5 (RHEL5)
+Details    : Define PAGE_SIZE when it isn't present.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>