Whamcloud - gitweb
LU-12705 build: fix building fail against Power9 little endian
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index 600e732..59d02de 100644 (file)
@@ -69,6 +69,7 @@
 #endif
 #include <poll.h>
 #include <time.h>
+#include <inttypes.h>
 
 #include <libcfs/util/ioctl.h>
 #include <libcfs/util/param.h>
@@ -405,7 +406,7 @@ int llapi_stripe_limit_check(unsigned long long stripe_size, int stripe_offset,
                rc = -EINVAL;
                llapi_error(LLAPI_MSG_ERROR, rc, "error: bad stripe_size %llu, "
                                "must be an even multiple of %d bytes",
-                               stripe_size, page_size);
+                               (unsigned long long)stripe_size, page_size);
                goto out;
        }
        if (!llapi_stripe_index_is_valid(stripe_offset)) {
@@ -424,7 +425,7 @@ int llapi_stripe_limit_check(unsigned long long stripe_size, int stripe_offset,
                rc = -EINVAL;
                llapi_error(LLAPI_MSG_ERROR, rc,
                            "error: stripe size '%llu' over 4GB limit",
-                           stripe_size);
+                           (unsigned long long)stripe_size);
                goto out;
        }
 
@@ -2703,10 +2704,10 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
                ver = (__u32)(lmm_oi_id(&lum->lmm_oi) >> 32);
                if (yaml)
                        llapi_printf(LLAPI_MSG_NORMAL, DFID_NOBRACE"\n",
-                                    seq, oid, ver);
+                                    (unsigned long long)seq, oid, ver);
                else
                        llapi_printf(LLAPI_MSG_NORMAL, DFID"\n",
-                                    seq, oid, ver);
+                                    (unsigned long long)seq, oid, ver);
        }
 
        if (verbose & VERBOSE_STRIPE_COUNT) {
@@ -2766,8 +2767,8 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
                        /* Extension size is in KiB */
                        llapi_printf(LLAPI_MSG_NORMAL, "%llu",
                                     extension ?
-                                    lum->lmm_stripe_size * SEL_UNIT_SIZE :
-                                    lum->lmm_stripe_size);
+                                    (unsigned long long)(lum->lmm_stripe_size * SEL_UNIT_SIZE) :
+                                    (unsigned long long)lum->lmm_stripe_size);
                }
                if (!yaml && is_dir)
                        separator = " ";
@@ -3185,7 +3186,7 @@ static void lov_dump_comp_v1_entry(struct find_param *param,
                                     "%4slcme_timestamp:      ", " ");
                if (yaml) {
                        llapi_printf(LLAPI_MSG_NORMAL, "%llu",
-                                                       entry->lcme_timestamp);
+                                    (unsigned long long)entry->lcme_timestamp);
                } else {
                        time_t stamp = entry->lcme_timestamp;
                        char *date_str = asctime(localtime(&stamp));
@@ -3203,7 +3204,7 @@ static void lov_dump_comp_v1_entry(struct find_param *param,
                        llapi_printf(LLAPI_MSG_NORMAL,
                                     "%4slcme_extent.e_start: ", " ");
                llapi_printf(LLAPI_MSG_NORMAL, "%llu",
-                            entry->lcme_extent.e_start);
+                            (unsigned long long)entry->lcme_extent.e_start);
                separator = "\n";
        }
 
@@ -3216,7 +3217,7 @@ static void lov_dump_comp_v1_entry(struct find_param *param,
                        llapi_printf(LLAPI_MSG_NORMAL, "%s", "EOF");
                else
                        llapi_printf(LLAPI_MSG_NORMAL, "%llu",
-                                       entry->lcme_extent.e_end);
+                                    (unsigned long long)entry->lcme_extent.e_end);
                separator = "\n";
        }