Okay PAGE_SIZE and friends isn't available for some arches in the
kernel, in fact the only architectures that PAGE_SIZE and friends are
available for code that isn't compiled with __KERNEL__ are i386, m32r,
ppc, s390, sh64, x86_64, so after trying to compile the debian
packages (which build the userspace components separate from the
kernel components) on ia64 it failed.

Attached is a patch to 'fix' the problem the first part of the patch
is what should be happening. The second part of the patch is a hack to
get the source to build for debian built ia64 kernels.

From comments on the LKML PAGE_SIZE shouldn't ever be used by
userspace and should be using getpagesize() and perform some functions
to get the other values (PAGE_MASK and PAGE_SHIFT).

Hopefully this helps,
- David Brown
diff --git a/lustre-1.5.97/lnet/libcfs/user-prim.c b/lustre-1.5.97/lnet/libcfs/user-prim.c
index ba8989e..16133f6 100644
--- a/lustre-1.5.97/lnet/libcfs/user-prim.c
+++ b/lustre-1.5.97/lnet/libcfs/user-prim.c
@@ -149,7 +149,7 @@ cfs_page_t *cfs_alloc_page(unsigned int flags)
 
         if (!pg)
                 return NULL;
-        pg->addr = malloc(PAGE_SIZE);
+        pg->addr = malloc(getpagesize());
 
         if (!pg->addr) {
                 free(pg);
diff --git a/lustre-1.5.97/lustre/include/liblustre.h b/lustre-1.5.97/lustre/include/liblustre.h
index d278d31..e4e99a6 100644
--- a/lustre-1.5.97/lustre/include/liblustre.h
+++ b/lustre-1.5.97/lustre/include/liblustre.h
@@ -383,7 +383,13 @@ static inline int kmem_cache_destroy(kmem_cache_t *a)
         free(a);
         return 0;
 }
-
+#ifndef __KERNEL__ 
+# ifdef __ia64__
+#  define PAGE_SHIFT 14
+#  define PAGE_SIZE (__IA64_UL_CONST(1) << PAGE_SHIFT)
+#  define PAGE_MASK (~(PAGE_SIZE-1))
+# endif
+#endif
 #define PAGE_CACHE_SIZE  PAGE_SIZE
 #define PAGE_CACHE_SHIFT PAGE_SHIFT
 #define PAGE_CACHE_MASK  PAGE_MASK
_______________________________________________
Lustre-discuss mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-discuss

Reply via email to