Whamcloud - gitweb
branch: HEAD
[fs/lustre-release.git] / lustre / include / linux / lustre_user.h
index a549214..bc67a18 100644 (file)
@@ -23,9 +23,6 @@
 # endif
 #else
 # include <linux/version.h>
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,21)
-#  define NEED_QUOTA_DEFS
-# endif
 # ifdef HAVE_QUOTA_SUPPORT
 #  include <linux/quota.h>
 # endif
@@ -57,26 +54,35 @@ typedef struct stat64   lstat_t;
 #endif
 
 #ifndef LPU64
+/* this is a bit chunky */
+#if defined(__KERNEL__)
+ #define _LWORDSIZE BITS_PER_LONG
+#else
+ #define _LWORDSIZE __WORDSIZE
+#endif
 /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
-#if defined(__x86_64__) && defined(__KERNEL__)
+#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3)))
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
 # define LPX64 "%#Lx"
 # define LPSZ  "%lu"
 # define LPSSZ "%ld"
-#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
+#elif (_LWORDSIZE == 32)
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
 # define LPX64 "%#Lx"
 # define LPSZ  "%u"
 # define LPSSZ "%d"
-#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
+#elif (_LWORDSIZE == 64)
 # define LPU64 "%lu"
 # define LPD64 "%ld"
 # define LPX64 "%#lx"
 # define LPSZ  "%lu"
 # define LPSSZ "%ld"
 #endif
+
+#undef _LWORDSIZE
+
 #endif /* !LPU64 */
 
 #endif /* _LUSTRE_USER_H */