Whamcloud - gitweb
LU-6401 lustre: make lustre_user.h compile in user space
[fs/lustre-release.git] / lustre / include / lustre / lustre_user.h
index 4f27ec3..ecb0a8c 100644 (file)
@@ -46,7 +46,7 @@
  * @{
  */
 
-#include <libcfs/types.h>
+#include <linux/types.h>
 
 #ifdef __KERNEL__
 # include <linux/quota.h>
@@ -54,6 +54,8 @@
 # include <linux/version.h>
 #else /* !__KERNEL__ */
 # define NEED_QUOTA_DEFS
+# include <limits.h>
+# include <stdbool.h>
 # include <stdio.h> /* snprintf() */
 # include <string.h>
 # include <sys/quota.h>
@@ -218,8 +220,9 @@ struct ost_id {
        };
 };
 
-#define DOSTID LPX64":"LPU64
-#define POSTID(oi) ostid_seq(oi), ostid_id(oi)
+#define DOSTID "%#llx:%llu"
+#define POSTID(oi) ((unsigned long long)ostid_seq(oi)), \
+                  ((unsigned long long)ostid_id(oi))
 
 struct ll_futimes_3 {
        __u64 lfu_atime_sec;
@@ -542,20 +545,14 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen)
    e.g. printf("file FID is "DFID"\n", PFID(fid)); */
 #define FID_NOBRACE_LEN 40
 #define FID_LEN (FID_NOBRACE_LEN + 2)
-#define DFID_NOBRACE LPX64":0x%x:0x%x"
+#define DFID_NOBRACE "%#llx:0x%x:0x%x"
 #define DFID "["DFID_NOBRACE"]"
-#define PFID(fid)     \
-        (fid)->f_seq, \
-        (fid)->f_oid, \
+#define PFID(fid)                              \
+       (unsigned long long)(fid)->f_seq,       \
+       (fid)->f_oid,                           \
         (fid)->f_ver
 
-/* scanf input parse format -- strip '[' first.
-   e.g. sscanf(fidstr, SFID, RFID(&fid)); */
-/* #define SFID "0x"LPX64i":0x"LPSZX":0x"LPSZX""
-liblustreapi.c:2893: warning: format '%lx' expects type 'long unsigned int *', but argument 4 has type 'unsigned int *'
-liblustreapi.c:2893: warning: format '%lx' expects type 'long unsigned int *', but argument 5 has type 'unsigned int *'
-*/
-#define SFID "0x"LPX64i":0x%x:0x%x"
+#define SFID "0x%llx:0x%x:0x%x"
 #define RFID(fid)     \
         &((fid)->f_seq), \
         &((fid)->f_oid), \