From ea536d7d37cdf1d2824e73191b2fcefff4054415 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Mon, 27 Aug 2007 10:02:19 +0000 Subject: [PATCH] Branch HEAD b=13360 i=isaac i=liangzhen Add PAGE_SIZE when it undef. --- lnet/include/libcfs/user-prim.h | 24 ++++++++++++++++++++++++ lustre/ChangeLog | 5 +++++ 2 files changed, 29 insertions(+) diff --git a/lnet/include/libcfs/user-prim.h b/lnet/include/libcfs/user-prim.h index 54f7832..d182041 100644 --- a/lnet/include/libcfs/user-prim.h +++ b/lnet/include/libcfs/user-prim.h @@ -46,6 +46,30 @@ #include #include #include +#include + +#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. diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 51912f6..56e9438 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -168,6 +168,11 @@ Bugzilla : 13039 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. -- 1.8.3.1