From 90e331eb686128af631ebb4c181a857bce9f407d Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 28 Apr 2005 19:50:10 +0000 Subject: [PATCH] Branch: b1_4 On Altix PAGE_SIZE is #defined as getpagesize() in userspace and CPP can't deal with that. Instead, assume we are limited by the RPC size and not the number of pages (which is currently true for any arch) and don't use PAGE_SIZE in any CPP conditionals. --- lustre/include/linux/lustre_net.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 4a711ea..31ad9a5 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -71,6 +71,7 @@ /* ...and make consistent... */ +#ifdef __KERNEL__ #if (PTLRPC_MAX_BRW_SIZE > PTLRPC_MAX_BRW_PAGES * PAGE_SIZE) # undef PTLRPC_MAX_BRW_SIZE # define PTLRPC_MAX_BRW_SIZE (PTLRPC_MAX_BRW_PAGES * PAGE_SIZE) @@ -82,10 +83,16 @@ #if ((PTLRPC_MAX_BRW_PAGES & (PTLRPC_MAX_BRW_PAGES - 1)) != 0) #error "PTLRPC_MAX_BRW_PAGES isn't a power of two" #endif +#else /* !__KERNEL__ */ +/* PAGE_SIZE isn't a constant, can't use CPP on it. We assume that the + * limit is on the number of pages for large pages, which is currently true. */ +# undef PTLRPC_MAX_BRW_PAGES +# define PTLRPC_MAX_BRW_PAGES (PTLRPC_MAX_BRW_SIZE / PAGE_SIZE) +#endif /* __KERNEL__ */ /* Size over which to OBD_VMALLOC() rather than OBD_ALLOC() service request * buffers */ -#define SVC_BUF_VMALLOC_THRESHOLD (2*PAGE_SIZE) +#define SVC_BUF_VMALLOC_THRESHOLD (2 * PAGE_SIZE) /* The following constants determine how memory is used to buffer incoming * service requests. -- 1.8.3.1