Whamcloud - gitweb
LU-12705 build: fix building fail against Power9 little endian
[fs/lustre-release.git] / lustre / utils / lfs.c
index 28e80cd..cf22944 100644 (file)
@@ -2242,14 +2242,14 @@ new_comp:
                if (lsa->lsa_stripe_count != LLAPI_LAYOUT_DEFAULT) {
                        fprintf(stderr, "Option 'stripe-count' can't be "
                                "specified with Data-on-MDT component: %lld\n",
-                               lsa->lsa_stripe_count);
+                               (long long)lsa->lsa_stripe_count);
                        errno = EINVAL;
                        return -1;
                }
                if (lsa->lsa_stripe_size != LLAPI_LAYOUT_DEFAULT) {
                        fprintf(stderr, "Option 'stripe-size' can't be "
                                "specified with Data-on-MDT component: %llu\n",
-                               lsa->lsa_stripe_size);
+                               (unsigned long long)lsa->lsa_stripe_size);
                        errno = EINVAL;
                        return -1;
                }
@@ -2263,7 +2263,7 @@ new_comp:
                if (lsa->lsa_stripe_off != LLAPI_LAYOUT_DEFAULT) {
                        fprintf(stderr, "Option 'stripe-offset' can't be "
                                "specified with Data-on-MDT component: %lld\n",
-                               lsa->lsa_stripe_off);
+                               (long long)lsa->lsa_stripe_off);
                        errno = EINVAL;
                        return -1;
                }
@@ -2278,7 +2278,8 @@ new_comp:
                rc = llapi_layout_pattern_set(layout, lsa->lsa_pattern);
                if (rc) {
                        fprintf(stderr, "Set stripe pattern %#llx failed. %s\n",
-                               lsa->lsa_pattern, strerror(errno));
+                               (unsigned long long)lsa->lsa_pattern,
+                               strerror(errno));
                        return rc;
                }
                /* Data-on-MDT component has always single stripe up to end */
@@ -2287,7 +2288,8 @@ new_comp:
                rc = llapi_layout_pattern_set(layout, lsa->lsa_pattern);
                if (rc) {
                        fprintf(stderr, "Set stripe pattern %#llx failed. %s\n",
-                               lsa->lsa_pattern, strerror(errno));
+                               (unsigned long long)lsa->lsa_pattern,
+                               strerror(errno));
                        return rc;
                }
        }
@@ -2309,7 +2311,7 @@ new_comp:
        rc = llapi_layout_stripe_count_set(layout, lsa->lsa_stripe_count);
        if (rc) {
                fprintf(stderr, "Set stripe count %lld failed: %s\n",
-                       lsa->lsa_stripe_count, strerror(errno));
+                       (long long)lsa->lsa_stripe_count, strerror(errno));
                return rc;
        }
 
@@ -2335,7 +2337,8 @@ new_comp:
                    lsa->lsa_stripe_count != LLAPI_LAYOUT_WIDE &&
                    lsa->lsa_nr_tgts != lsa->lsa_stripe_count) {
                        fprintf(stderr, "stripe_count(%lld) != nr_tgts(%d)\n",
-                               lsa->lsa_stripe_count, lsa->lsa_nr_tgts);
+                               (long long)lsa->lsa_stripe_count,
+                               lsa->lsa_nr_tgts);
                        errno = EINVAL;
                        return -1;
                }
@@ -3577,8 +3580,9 @@ static int lfs_setstripe_internal(int argc, char **argv,
                            lsa.lsa_stripe_count != lsa.lsa_nr_tgts) {
                                fprintf(stderr,
                                        "error: %s: stripe count %lld doesn't match the number of MDTs: %d\n",
-                                       progname, lsa.lsa_stripe_count,
-                                               lsa.lsa_nr_tgts);
+                                       progname,
+                                       (long long)lsa.lsa_stripe_count,
+                                       lsa.lsa_nr_tgts);
                                free(lmu);
                                goto usage_error;
                        }
@@ -3632,9 +3636,10 @@ static int lfs_setstripe_internal(int argc, char **argv,
                            lsa.lsa_stripe_count != LLAPI_LAYOUT_DEFAULT &&
                            lsa.lsa_stripe_count != LLAPI_LAYOUT_WIDE &&
                            lsa.lsa_nr_tgts != lsa.lsa_stripe_count) {
-                               fprintf(stderr, "error: %s: stripe count %lld "
-                                       "doesn't match the number of OSTs: %d\n"
-                                       , argv[0], lsa.lsa_stripe_count,
+                               fprintf(stderr,
+                                       "error: %s: stripe count %lld doesn't match the number of OSTs: %d\n",
+                                       argv[0],
+                                       (long long)lsa.lsa_stripe_count,
                                        lsa.lsa_nr_tgts);
                                free(param);
                                goto usage_error;
@@ -5675,9 +5680,10 @@ static int lfs_setdirstripe(int argc, char **argv)
                if (lsa.lsa_stripe_count > 0 &&
                    lsa.lsa_stripe_count != LLAPI_LAYOUT_DEFAULT &&
                    lsa.lsa_stripe_count != lsa.lsa_nr_tgts) {
-                       fprintf(stderr, "error: %s: stripe count %lld doesn't "
-                               "match the number of MDTs: %d\n",
-                               argv[0], lsa.lsa_stripe_count, lsa.lsa_nr_tgts);
+                       fprintf(stderr,
+                               "error: %s: stripe count %lld doesn't match the number of MDTs: %d\n",
+                               argv[0], (long long)lsa.lsa_stripe_count,
+                               lsa.lsa_nr_tgts);
                        free(param);
                        return CMD_HELP;
                }
@@ -6437,7 +6443,8 @@ quota_type_def:
                                fprintf(stderr,
                                        "%s setquota: warning: block softlimit '%llu' smaller than minimum qunit size\n"
                                        "See '%s help setquota' or Lustre manual for details\n",
-                                       progname, dqb->dqb_bsoftlimit,
+                                       progname,
+                                       (unsigned long long)dqb->dqb_bsoftlimit,
                                        progname);
                        break;
                case 'B':
@@ -6449,7 +6456,8 @@ quota_type_def:
                                fprintf(stderr,
                                        "%s setquota: warning: block hardlimit '%llu' smaller than minimum qunit size\n"
                                        "See '%s help setquota' or Lustre manual for details\n",
-                                       progname, dqb->dqb_bhardlimit,
+                                       progname,
+                                       (unsigned long long)dqb->dqb_bhardlimit,
                                        progname);
                        break;
                case 'i':
@@ -6460,7 +6468,8 @@ quota_type_def:
                                fprintf(stderr,
                                        "%s setquota: warning: inode softlimit '%llu' smaller than minimum qunit size\n"
                                        "See '%s help setquota' or Lustre manual for details\n",
-                                       progname, dqb->dqb_isoftlimit,
+                                       progname,
+                                       (unsigned long long)dqb->dqb_isoftlimit,
                                        progname);
                        break;
                case 'I':
@@ -6471,7 +6480,8 @@ quota_type_def:
                                fprintf(stderr,
                                        "%s setquota: warning: inode hardlimit '%llu' smaller than minimum qunit size\n"
                                        "See '%s help setquota' or Lustre manual for details\n",
-                                       progname, dqb->dqb_ihardlimit,
+                                       progname,
+                                       (unsigned long long)dqb->dqb_ihardlimit,
                                        progname);
                        break;
                default:
@@ -6721,7 +6731,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type,
                        diff2str(dqb->dqb_btime, timebuf, now);
                else if (show_default)
                        snprintf(timebuf, sizeof(timebuf), "%llu",
-                                dqb->dqb_btime);
+                                (unsigned long long)dqb->dqb_btime);
 
                kbytes2str(lustre_stoqb(dqb->dqb_curspace),
                           strbuf, sizeof(strbuf), h);
@@ -6754,7 +6764,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type,
                        diff2str(dqb->dqb_itime, timebuf, now);
                else if (show_default)
                        snprintf(timebuf, sizeof(timebuf), "%llu",
-                                dqb->dqb_itime);
+                                (unsigned long long)dqb->dqb_itime);
 
                snprintf(numbuf[0], sizeof(numbuf),
                         (dqb->dqb_valid & QIF_INODES) ? "%ju" : "[%ju]",
@@ -7416,14 +7426,16 @@ static int lfs_changelog(int argc, char **argv)
                        struct changelog_ext_extra_flags *ef =
                                changelog_rec_extra_flags(rec);
 
-                       printf(" ef=0x%llx", ef->cr_extra_flags);
+                       printf(" ef=0x%llx",
+                              (unsigned long long)ef->cr_extra_flags);
 
                        if (ef->cr_extra_flags & CLFE_UIDGID) {
                                struct changelog_ext_uidgid *uidgid =
                                        changelog_rec_uidgid(rec);
 
                                printf(" u=%llu:%llu",
-                                      uidgid->cr_uid, uidgid->cr_gid);
+                                      (unsigned long long)uidgid->cr_uid,
+                                      (unsigned long long)uidgid->cr_gid);
                        }
                        if (ef->cr_extra_flags & CLFE_NID) {
                                struct changelog_ext_nid *nid =
@@ -8639,7 +8651,8 @@ static int lfs_heat_get(int argc, char **argv)
 
                printf("flags: %x\n", heat->lh_flags);
                for (i = 0; i < heat->lh_count; i++)
-                       printf("%s: %llu\n", heat_names[i], heat->lh_heat[i]);
+                       printf("%s: %llu\n", heat_names[i],
+                              (unsigned long long)heat->lh_heat[i]);
 next:
                if (rc == 0 && rc2 < 0)
                        rc = rc2;
@@ -10595,14 +10608,15 @@ static int lfs_getsom(int argc, char **argv)
        switch (type) {
        case LFS_SOM_ATTR_ALL:
                printf("file: %s size: %llu blocks: %llu flags: %x\n",
-                      path, attrs->lsa_size, attrs->lsa_blocks,
+                      path, (unsigned long long)attrs->lsa_size,
+                      (unsigned long long)attrs->lsa_blocks,
                       attrs->lsa_valid);
                break;
        case LFS_SOM_SIZE:
-               printf("%llu\n", attrs->lsa_size);
+               printf("%llu\n", (unsigned long long)attrs->lsa_size);
                break;
        case LFS_SOM_BLOCKS:
-               printf("%llu\n", attrs->lsa_blocks);
+               printf("%llu\n", (unsigned long long)attrs->lsa_blocks);
                break;
        case LFS_SOM_FLAGS:
                printf("%x\n", attrs->lsa_valid);