Various portability fixes so that we can build without warnings on 64-bit
architectures.
i=fanyong
i=rread
28 files changed:
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPF64 "L"
#else
# define LPU64 "%lu"
# define LPD64 "%ld"
# define LPX64 "%#lx"
# define LPF64 "L"
#else
# define LPU64 "%lu"
# define LPD64 "%ld"
# define LPX64 "%#lx"
# define LPF64 "l"
#endif
# define LPF64 "l"
#endif
#ifdef HAVE_SIZE_T_LONG
# define LPSZ "%lu"
#ifdef HAVE_SIZE_T_LONG
# define LPSZ "%lu"
#endif
#ifdef HAVE_SSIZE_T_LONG
#endif
#ifdef HAVE_SSIZE_T_LONG
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPF64 "L"
#elif (BITS_PER_LONG == 32)
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPF64 "L"
#elif (BITS_PER_LONG == 32)
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPF64 "L"
#elif (BITS_PER_LONG == 64)
# define LPU64 "%lu"
# define LPD64 "%ld"
# define LPX64 "%#lx"
# define LPF64 "L"
#elif (BITS_PER_LONG == 64)
# define LPU64 "%lu"
# define LPD64 "%ld"
# define LPX64 "%#lx"
# define LPF64 "l"
#endif
#ifdef HAVE_SIZE_T_LONG
# define LPSZ "%lu"
# define LPF64 "l"
#endif
#ifdef HAVE_SIZE_T_LONG
# define LPSZ "%lu"
#endif
#ifdef HAVE_SSIZE_T_LONG
#endif
#ifdef HAVE_SSIZE_T_LONG
- fprintf(stdout, "%s ID: %Lu@%s, KEY: %d NODES: %d\n",
+ fprintf(stdout, "%s ID: "LPU64"@%s, KEY: %d NODES: %d\n",
name, sid.ses_stamp, libcfs_nid2str(sid.ses_nid),
key, ndinfo.nle_nnode);
name, sid.ses_stamp, libcfs_nid2str(sid.ses_nid),
key, ndinfo.nle_nnode);
- fprintf(stdout, "Session %s, ID: %s, %Lu\n",
+ fprintf(stdout, "Session %s, ID: %s, "LPU64"\n",
ses, libcfs_nid2str(rep->join_sid.ses_nid),
rep->join_sid.ses_stamp);
ses, libcfs_nid2str(rep->join_sid.ses_nid),
rep->join_sid.ses_stamp);
- CDEBUG(D_INFO, "%s: lookup seq = %llx range : "DRANGE" rc = %d\n",
+ CDEBUG(D_INFO, "%s: lookup seq = "LPX64" range : "DRANGE" rc = %d\n",
fld->lsf_name, seq, PRANGE(range), rc);
RETURN(rc);
fld->lsf_name, seq, PRANGE(range), rc);
RETURN(rc);
/* scanf input parse format -- strip '[' first.
e.g. sscanf(fidstr, SFID, RFID(&fid)); */
/* scanf input parse format -- strip '[' first.
e.g. sscanf(fidstr, SFID, RFID(&fid)); */
-#define SFID "0x%llx:0x%x:0x%x"
+/* #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 RFID(fid) \
&((fid)->f_seq), \
&((fid)->f_oid), \
#define RFID(fid) \
&((fid)->f_seq), \
&((fid)->f_oid), \
if (lock->cll_descr.cld_start == 0 &&
lock->cll_descr.cld_end == CL_PAGE_EOF) {
cl_isize_write_nolock(inode, attr->cat_kms);
if (lock->cll_descr.cld_start == 0 &&
lock->cll_descr.cld_end == CL_PAGE_EOF) {
cl_isize_write_nolock(inode, attr->cat_kms);
- CDEBUG(D_INODE, DFID" updating i_size %llu\n",
+ CDEBUG(D_INODE, DFID" updating i_size "LPU64"\n",
PFID(lu_object_fid(&obj->co_lu)),
(__u64)cl_isize_read(inode));
}
PFID(lu_object_fid(&obj->co_lu)),
(__u64)cl_isize_read(inode));
}
GOTO(out, err);
CDEBUG(D_INODE,
GOTO(out, err);
CDEBUG(D_INODE,
- "%s ino %lu, %lu bytes, offset %lld, i_size %llu\n",
+ "%s ino %lu, %lu bytes, offset "LPU64", i_size "LPU64"\n",
write ? "Write" : "Read", (unsigned long)st->st_ino,
cnt, (__u64)pos, (__u64)st->st_size);
write ? "Write" : "Read", (unsigned long)st->st_ino,
cnt, (__u64)pos, (__u64)st->st_size);
lvb = req_capsule_server_get(&req->rq_pill, &RMF_DLM_LVB);
lvb->lvb_size = lli->lli_smd->lsm_oinfo[stripe]->loi_kms;
lvb = req_capsule_server_get(&req->rq_pill, &RMF_DLM_LVB);
lvb->lvb_size = lli->lli_smd->lsm_oinfo[stripe]->loi_kms;
- LDLM_DEBUG(lock, "i_size: %llu -> stripe number %u -> kms "LPU64,
+ LDLM_DEBUG(lock, "i_size: "LPU64" -> stripe number %u -> kms "LPU64,
(__u64)llu_i2stat(inode)->st_size, stripe,lvb->lvb_size);
iput:
I_RELE(inode);
(__u64)llu_i2stat(inode)->st_size, stripe,lvb->lvb_size);
iput:
I_RELE(inode);
(sbi->ll_flags & LL_SBI_NOLCK) || mode == LCK_NL)
RETURN(0);
(sbi->ll_flags & LL_SBI_NOLCK) || mode == LCK_NL)
RETURN(0);
- CDEBUG(D_DLMTRACE, "Locking inode %llu, start "LPU64" end "LPU64"\n",
+ CDEBUG(D_DLMTRACE, "Locking inode "LPU64", start "LPU64" end "LPU64"\n",
(__u64)st->st_ino, policy->l_extent.start,
policy->l_extent.end);
(__u64)st->st_ino, policy->l_extent.start,
policy->l_extent.end);
{
char path[MAX_PATH_LENGTH];
int fd;
{
char path[MAX_PATH_LENGTH];
int fd;
- off_t ret;
- off_t off;
+ long long ret;
+ loff_t off;
ENTER("handle seek > 2GB");
snprintf(path, MAX_PATH_LENGTH, "%s/f%s", lustre_path, name);
ENTER("handle seek > 2GB");
snprintf(path, MAX_PATH_LENGTH, "%s/f%s", lustre_path, name);
ret = lseek(fd, -buf_size + 2, SEEK_CUR);
if (ret != off) {
printf("relative seek error for %d %llu != %llu\n",
ret = lseek(fd, -buf_size + 2, SEEK_CUR);
if (ret != off) {
printf("relative seek error for %d %llu != %llu\n",
- -buf_size + 2, ret, off);
+ -buf_size + 2, ret, (unsigned long long) off);
if (ret == -1)
perror("relative seek");
return -1;
if (ret == -1)
perror("relative seek");
return -1;
off = 2048ULL * 1024 * 1024, SEEK_SET;
ret = lseek(fd, off, SEEK_SET);
if (ret != off) {
off = 2048ULL * 1024 * 1024, SEEK_SET;
ret = lseek(fd, off, SEEK_SET);
if (ret != off) {
- printf("seek 2GB error for %llu != %llu\n", ret, off);
+ printf("seek 2GB error for %llu != %llu\n", ret, (unsigned long long) off);
if (ret == -1)
perror("seek 2GB");
return -1;
if (ret == -1)
perror("seek 2GB");
return -1;
CDEBUG(D_INODE,
""DFID" reset end "LPX64" tgt %d\n",
PFID(&rid),
CDEBUG(D_INODE,
""DFID" reset end "LPX64" tgt %d\n",
PFID(&rid),
- le64_to_cpu(dp->ldp_hash_end), tgt_idx);
+ (__u64)le64_to_cpu(dp->ldp_hash_end), tgt_idx);
start, end);
rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
lov_sub_put(sub);
start, end);
rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
lov_sub_put(sub);
- CDEBUG(D_VFSTRACE, "shrink: %i [%llu, %llu)\n",
+ CDEBUG(D_VFSTRACE, "shrink: %i ["LPU64", "LPU64")\n",
stripe, start, end);
} else
rc = PTR_ERR(sub);
stripe, start, end);
} else
rc = PTR_ERR(sub);
next) - io->u.ci_rw.crw_pos;
lio->lis_pos = io->u.ci_rw.crw_pos;
lio->lis_endpos = io->u.ci_rw.crw_pos + io->u.ci_rw.crw_count;
next) - io->u.ci_rw.crw_pos;
lio->lis_pos = io->u.ci_rw.crw_pos;
lio->lis_endpos = io->u.ci_rw.crw_pos + io->u.ci_rw.crw_count;
- CDEBUG(D_VFSTRACE, "stripe: %llu chunk: [%llu, %llu) %llu\n",
+ CDEBUG(D_VFSTRACE, "stripe: "LPU64" chunk: ["LPU64", "LPU64") "LPU64"\n",
(__u64)start, lio->lis_pos, lio->lis_endpos,
(__u64)lio->lis_io_endpos);
}
(__u64)start, lio->lis_pos, lio->lis_endpos,
(__u64)lio->lis_io_endpos);
}
rc = lov_merge_lvb_kms(lsm, lvb, &kms);
if (kms_only)
lvb->lvb_size = kms;
rc = lov_merge_lvb_kms(lsm, lvb, &kms);
if (kms_only)
lvb->lvb_size = kms;
- CDEBUG(D_INODE, "merged: %llu %llu %llu %llu %llu\n",
+ CDEBUG(D_INODE, "merged: "LPU64" "LPU64" "LPU64" "LPU64" "LPU64"\n",
lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime,
lvb->lvb_ctime, lvb->lvb_blocks);
RETURN(rc);
lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime,
lvb->lvb_ctime, lvb->lvb_blocks);
RETURN(rc);
struct lov_mds_md *lmm = lmmp;
CDEBUG(level, "objid "LPX64", magic 0x%08x, pattern %#x\n",
struct lov_mds_md *lmm = lmmp;
CDEBUG(level, "objid "LPX64", magic 0x%08x, pattern %#x\n",
- le64_to_cpu(lmm->lmm_object_id),
+ (__u64)le64_to_cpu(lmm->lmm_object_id),
le32_to_cpu(lmm->lmm_magic),
le32_to_cpu(lmm->lmm_pattern));
CDEBUG(level,"stripe_size %u, stripe_count %u\n",
le32_to_cpu(lmm->lmm_magic),
le32_to_cpu(lmm->lmm_pattern));
CDEBUG(level,"stripe_size %u, stripe_count %u\n",
for (i = 0; i < stripe_count; ++i, ++lod) {
CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", i,
le32_to_cpu(lod->l_ost_idx),
for (i = 0; i < stripe_count; ++i, ++lod) {
CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", i,
le32_to_cpu(lod->l_ost_idx),
- le64_to_cpu(lod->l_object_gr),
- le64_to_cpu(lod->l_object_id));
+ (__u64)le64_to_cpu(lod->l_object_gr),
+ (__u64)le64_to_cpu(lod->l_object_id));
- CDEBUG(D_IOCTL, "Purge request: id=%d, endrec="LPD64"\n", id, endrec);
+ CDEBUG(D_IOCTL, "Purge request: id=%d, endrec=%lld\n", id, endrec);
data.mcud_id = id;
data.mcud_minid = 0;
data.mcud_id = id;
data.mcud_minid = 0;
{
struct mdd_object *mdd = lu2mdd_obj((struct lu_object *)o);
return (*p)(env, cookie, LUSTRE_MDD_NAME"-object@%p(open_count=%d, "
{
struct mdd_object *mdd = lu2mdd_obj((struct lu_object *)o);
return (*p)(env, cookie, LUSTRE_MDD_NAME"-object@%p(open_count=%d, "
- "valid=%x, cltime=%llu, flags=%lx)",
+ "valid=%x, cltime="LPU64", flags=%lx)",
mdd, mdd->mod_count, mdd->mod_valid,
mdd->mod_cltime, mdd->mod_flags);
}
mdd, mdd->mod_count, mdd->mod_valid,
mdd->mod_cltime, mdd->mod_flags);
}
- rc = snprintf(key, NAME_MAX + 1, ORPHAN_FILE_NAME_FORMAT, fid_seq(lf),
+ rc = snprintf(key, NAME_MAX + 1, ORPHAN_FILE_NAME_FORMAT,
+ (long long unsigned int)fid_seq(lf),
fid_oid(lf), fid_ver(lf), op);
if (rc > 0)
return (struct dt_key*) key;
fid_oid(lf), fid_ver(lf), op);
if (rc > 0)
return (struct dt_key*) key;
int rc = 0;
unsigned int op;
int rc = 0;
unsigned int op;
- rc = sscanf(key, ORPHAN_FILE_NAME_FORMAT, &lf->f_seq, &lf->f_oid,
+ rc = sscanf(key, ORPHAN_FILE_NAME_FORMAT,
+ (long long unsigned int *)&lf->f_seq, &lf->f_oid,
&lf->f_ver, &op);
if (rc == 4)
return 0;
/* build igif */
rc = sscanf(key, ORPHAN_FILE_NAME_FORMAT_18,
&lf->f_ver, &op);
if (rc == 4)
return 0;
/* build igif */
rc = sscanf(key, ORPHAN_FILE_NAME_FORMAT_18,
- &lf->f_seq, &lf->f_oid);
+ (long long unsigned int *)&lf->f_seq, &lf->f_oid);
if (rc == 2) {
lf->f_ver = 0;
return 0;
if (rc == 2) {
lf->f_ver = 0;
return 0;
lu_printer_t p, const struct lu_object *o)
{
struct mdt_object *mdto = mdt_obj((struct lu_object *)o);
lu_printer_t p, const struct lu_object *o)
{
struct mdt_object *mdto = mdt_obj((struct lu_object *)o);
- return (*p)(env, cookie, LUSTRE_MDT_NAME"-object@%p(ioepoch=%llu "
- "flags=%llx, epochcount=%d, writecount=%d)",
+ return (*p)(env, cookie, LUSTRE_MDT_NAME"-object@%p(ioepoch="LPU64" "
+ "flags="LPX64", epochcount=%d, writecount=%d)",
mdto, mdto->mot_ioepoch, mdto->mot_flags,
mdto->mot_ioepoch_count, mdto->mot_writecount);
}
mdto, mdto->mot_ioepoch, mdto->mot_flags,
mdto->mot_ioepoch_count, mdto->mot_writecount);
}
ATTR_ATTR_FLAG|ATTR_RAW|MDS_OPEN_OWNEROVERRIDE|
ATTR_FORCE|ATTR_KILL_SUID|ATTR_KILL_SGID);
if (in != 0)
ATTR_ATTR_FLAG|ATTR_RAW|MDS_OPEN_OWNEROVERRIDE|
ATTR_FORCE|ATTR_KILL_SUID|ATTR_KILL_SGID);
if (in != 0)
- CERROR("Unknown attr bits: %#llx\n", in);
+ CERROR("Unknown attr bits: "LPX64"\n", in);
return out;
}
/* unpacking */
return out;
}
/* unpacking */
}
cfs_spin_unlock(&mdt->mdt_transno_lock);
}
cfs_spin_unlock(&mdt->mdt_transno_lock);
- CDEBUG(D_INODE, "transno = %llu, last_committed = %llu\n",
+ CDEBUG(D_INODE, "transno = "LPU64", last_committed = "LPU64"\n",
info->mti_transno,
req->rq_export->exp_obd->obd_last_committed);
info->mti_transno,
req->rq_export->exp_obd->obd_last_committed);
mdt_versions_set(mti);
/* filling reply data */
mdt_versions_set(mti);
/* filling reply data */
- CDEBUG(D_INODE, "transno = %llu, last_committed = %llu\n",
+ CDEBUG(D_INODE, "transno = "LPU64", last_committed = "LPU64"\n",
mti->mti_transno, req->rq_export->exp_obd->obd_last_committed);
req->rq_transno = mti->mti_transno;
mti->mti_transno, req->rq_export->exp_obd->obd_last_committed);
req->rq_transno = mti->mti_transno;
if (unlikely(!(valid & OBD_MD_FLCTIME))) {
CWARN("client miss to set OBD_MD_FLCTIME when "
if (unlikely(!(valid & OBD_MD_FLCTIME))) {
CWARN("client miss to set OBD_MD_FLCTIME when "
- "setxattr: [object "DFID"] [valid %llu]\n",
+ "setxattr: [object "DFID"] [valid "LPU64"]\n",
PFID(rr->rr_fid1), valid);
attr->la_ctime = cfs_time_current_sec();
}
PFID(rr->rr_fid1), valid);
attr->la_ctime = cfs_time_current_sec();
}
cfs_spin_lock (&ec->ec_lock);
cfs_list_for_each (el, &ec->ec_locks) {
ecl = cfs_list_entry (el, struct echo_lock, el_chain);
cfs_spin_lock (&ec->ec_lock);
cfs_list_for_each (el, &ec->ec_locks) {
ecl = cfs_list_entry (el, struct echo_lock, el_chain);
- CDEBUG(D_INFO, "ecl: %p, cookie: %llx\n", ecl, ecl->el_cookie);
+ CDEBUG(D_INFO, "ecl: %p, cookie: "LPX64"\n", ecl, ecl->el_cookie);
found = (ecl->el_cookie == cookie);
if (found) {
if (cfs_atomic_dec_and_test(&ecl->el_refcount))
found = (ecl->el_cookie == cookie);
if (found) {
if (cfs_atomic_dec_and_test(&ecl->el_refcount))
rc = cl_echo_enqueue(eco, offset, end, mode, &ulh->cookie);
if (rc == 0) {
oa->o_valid |= OBD_MD_FLHANDLE;
rc = cl_echo_enqueue(eco, offset, end, mode, &ulh->cookie);
if (rc == 0) {
oa->o_valid |= OBD_MD_FLHANDLE;
- CDEBUG(D_INFO, "Cookie is %llx\n", ulh->cookie);
+ CDEBUG(D_INFO, "Cookie is "LPX64"\n", ulh->cookie);
}
echo_put_object(eco);
RETURN(rc);
}
echo_put_object(eco);
RETURN(rc);
if ((oa->o_valid & OBD_MD_FLHANDLE) == 0)
return -EINVAL;
if ((oa->o_valid & OBD_MD_FLHANDLE) == 0)
return -EINVAL;
- CDEBUG(D_INFO, "Cookie is %llx\n", cookie);
+ CDEBUG(D_INFO, "Cookie is "LPX64"\n", cookie);
return cl_echo_cancel(ed, cookie);
}
return cl_echo_cancel(ed, cookie);
}
return (*printer)(env, cookie, LUSTRE_OSC_NAME"-page@%p: "
"1< %#x %d %u %s %s %s > "
return (*printer)(env, cookie, LUSTRE_OSC_NAME"-page@%p: "
"1< %#x %d %u %s %s %s > "
- "2< %llu %u %#x %#x | %p %p %p %p %p > "
+ "2< "LPU64" %u %#x %#x | %p %p %p %p %p > "
"3< %s %p %d %lu %d > "
"4< %d %d %d %lu %s | %s %s %s %s > "
"5< %s %s %s %s | %d %s %s | %d %s %s>\n",
"3< %s %p %d %lu %d > "
"4< %d %d %d %lu %s | %s %s %s %s > "
"5< %s %s %s %s | %d %s %s | %d %s %s>\n",
if (req == NULL)
RETURN(-ENOMEM);
if (req == NULL)
RETURN(-ENOMEM);
- CDEBUG(D_OTHER, "%s mount_count %llu, connection count %llu\n",
+ CDEBUG(D_OTHER, "%s mount_count "LPU64", connection count "LPU64"\n",
ctxt->loc_exp->exp_obd->obd_type->typ_name,
ctxt->loc_gen.mnt_cnt, ctxt->loc_gen.conn_cnt);
ctxt->loc_exp->exp_obd->obd_type->typ_name,
ctxt->loc_gen.mnt_cnt, ctxt->loc_gen.conn_cnt);
if (statuslog != NULL)
printf("Statuslog: %s\n", statuslog);
printf("Changelog registration: %s\n", status->ls_registration);
if (statuslog != NULL)
printf("Statuslog: %s\n", statuslog);
printf("Changelog registration: %s\n", status->ls_registration);
- printf("Starting changelog record: %lld\n", status->ls_last_recno);
+ printf("Starting changelog record: "LPD64"\n", status->ls_last_recno);
if (noxattr)
printf("Replicate xattrs: no\n");
if (noclear)
if (noxattr)
printf("Replicate xattrs: no\n");
if (noclear)
vprint("formatting backing filesystem %s on %s\n",
MT_STR(&mop->mo_ldd), dev);
vprint("\ttarget name %s\n", mop->mo_ldd.ldd_svname);
vprint("formatting backing filesystem %s on %s\n",
MT_STR(&mop->mo_ldd), dev);
vprint("\ttarget name %s\n", mop->mo_ldd.ldd_svname);
- vprint("\t4k blocks %llu\n", block_count);
+ vprint("\t4k blocks "LPU64"\n", block_count);
vprint("\toptions %s\n", mop->mo_mkfsopts);
/* mkfs_cmd's trailing space is important! */
vprint("\toptions %s\n", mop->mo_mkfsopts);
/* mkfs_cmd's trailing space is important! */
strscat(mkfs_cmd, " ", sizeof(mkfs_cmd));
strscat(mkfs_cmd, dev, sizeof(mkfs_cmd));
if (block_count != 0) {
strscat(mkfs_cmd, " ", sizeof(mkfs_cmd));
strscat(mkfs_cmd, dev, sizeof(mkfs_cmd));
if (block_count != 0) {
- sprintf(buf, " %llu", block_count);
+ sprintf(buf, " "LPU64, block_count);
strscat(mkfs_cmd, buf, sizeof(mkfs_cmd));
}
strscat(mkfs_cmd, buf, sizeof(mkfs_cmd));
}
}
obd_ioctl_unpack(&data, buf, sizeof rawbuf);
}
obd_ioctl_unpack(&data, buf, sizeof rawbuf);
- printf("0x%llx\n", version);
+ printf("0x"LPX64"\n", version);