};
#define DEXT "[%#llx, %#llx)"
-#define PEXT(ext) (ext)->e_start, (ext)->e_end
+#define PEXT(ext) (unsigned long long)(ext)->e_start, (unsigned long long)(ext)->e_end
static inline bool lu_extent_is_overlapped(struct lu_extent *e1,
struct lu_extent *e2)
* Need to strip '[' from DFID format first or use "["SFID"]" at caller.
* usage: sscanf(fidstr, SFID, RFID(&fid)); */
#define SFID "0x%llx:0x%x:0x%x"
-#define RFID(fid) &((fid)->f_seq), &((fid)->f_oid), &((fid)->f_ver)
+#define RFID(fid) (unsigned long long *)&((fid)->f_seq), &((fid)->f_oid), &((fid)->f_ver)
/********* Quotas **********/
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;
}
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;
}
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 */
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;
}
}
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;
}
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;
}
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;
}
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;
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;
}
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':
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':
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':
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:
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);
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]",
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 =
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;
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);
CT_TRACE("bandwith control: %lluB/s "
"excess=%llu sleep for "
"%lld.%09lds",
- opt.o_bandwidth, excess,
+ (unsigned long long)opt.o_bandwidth,
+ (unsigned long long)excess,
(long long)delay.tv_sec,
delay.tv_nsec);
last_bw_print = now;
#endif
#include <poll.h>
#include <time.h>
+#include <inttypes.h>
#include <libcfs/util/ioctl.h>
#include <libcfs/util/param.h>
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)) {
rc = -EINVAL;
llapi_error(LLAPI_MSG_ERROR, rc,
"error: stripe size '%llu' over 4GB limit",
- stripe_size);
+ (unsigned long long)stripe_size);
goto out;
}
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) {
/* 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 = " ";
"%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));
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";
}
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";
}
printf("%s: parent="DFID" stripe=%u "
"stripe_size=%u stripe_count=%u",
- argv[i], loa->loa_parent_fid.f_seq,
+ argv[i],
+ (unsigned long long)loa->loa_parent_fid.f_seq,
loa->loa_parent_fid.f_oid, 0, /* ver */
loa->loa_parent_fid.f_stripe_idx &
PFID_STRIPE_COUNT_MASK,
if (leh->leh_len > size) {
fprintf(stderr,
"%s: invalid length %llu, should smaller than %zd\n",
- fname, leh->leh_len, size);
+ fname, (unsigned long long)leh->leh_len, size);
return -1;
}
length += reclen;
if (length > leh->leh_len) {
fprintf(stderr,
- "%s: length exceeded, expected %lld, got %lld\n",
- fname, leh->leh_len, length);
+ "%s: length exceeded, expected %llu, got %llu\n",
+ fname, (unsigned long long)leh->leh_len,
+ (unsigned long long)length);
return -1;
}
memcpy(&pfid, &lee->lee_parent_fid, sizeof(pfid));
if (length != leh->leh_len) {
fprintf(stderr,
- "%s: length mismatch, expected %lld, got %lld\n",
- fname, leh->leh_len, length);
+ "%s: length mismatch, expected %llu, got %llu\n",
+ fname,
+ (unsigned long long)leh->leh_len,
+ (unsigned long long)length);
return -1;
}
llapi_printf(LLAPI_MSG_DEBUG,
"record %llu:%llu, updated LSOM for fid " DFID
- " size:%lu blocks:%lu\n", f->fr_time, f->fr_index,
+ " size:%lu blocks:%lu\n",
+ (unsigned long long)f->fr_time,
+ (unsigned long long)f->fr_index,
PFID(&f->fr_fid), st.st_size, st.st_blocks);
clean_up:
if (rc)
llapi_error(LLAPI_MSG_ERROR, rc,
"failed to clear changelog record: %s:%llu",
- opt.o_chlg_user, f->fr_index);
+ opt.o_chlg_user, (unsigned long long)f->fr_index);
return rc;
}
}
}
- llapi_printf(LLAPI_MSG_DEBUG, "Processed changelog record index:%llu "
- "type:%s(0x%x) FID:"DFID"\n", index,
+ llapi_printf(LLAPI_MSG_DEBUG,
+ "Processed changelog record index:%llu type:%s(0x%x) FID:"DFID"\n",
+ (unsigned long long)index,
changelog_type2str(__le32_to_cpu(rec->cr_type)),
__le32_to_cpu(rec->cr_type), PFID(&rec->cr_tfid));
#include <time.h>
#include <unistd.h>
#include <limits.h>
-
#include "obdctl.h"
#include "lustreapi_internal.h"
#include <libcfs/util/list.h>
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
if (objid >= OBIF_MAX_OID) {
fprintf(stderr, "errr: %s: invalid objid '%llu'\n",
- jt_cmdname(argv[0]), objid);
+ jt_cmdname(argv[0]), (unsigned long long)objid);
return -E2BIG;
}
i++, id++) {
if (id >= OBIF_MAX_OID) {
fprintf(stderr, "errr: %s: invalid objid '%llu'\n",
- jt_cmdname(argv[0]), id);
+ jt_cmdname(argv[0]), (unsigned long long)id);
return -E2BIG;
}
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
if (objid >= OBIF_MAX_OID) {
fprintf(stderr, "errr: %s: invalid objid '%llu'\n",
- jt_cmdname(argv[0]), objid);
+ jt_cmdname(argv[0]), (unsigned long long)objid);
return -E2BIG;
}
ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
if (objid >= OBIF_MAX_OID) {
fprintf(stderr, "errr: %s: invalid objid '%llu'\n",
- jt_cmdname(argv[0]), objid);
+ jt_cmdname(argv[0]), (unsigned long long)objid);
return -E2BIG;
}