fix 32-bit-build-smoke warnings

fixes: bz#1622665

Change-Id: I777d67b1b62c284c62a02277238ad7538eef001e
Signed-off-by: Iraj Jamali <ijamali@redhat.com>
This commit is contained in:
Iraj Jamali 2018-12-17 11:23:59 +05:30 committed by Amar Tumballi
parent c0c2022e7d
commit 01779e6c6c
15 changed files with 39 additions and 35 deletions

View File

@ -1702,7 +1702,7 @@ gf_uint64_2human_readable(uint64_t n)
if (ret < 0)
goto err;
} else {
ret = gf_asprintf(&str, "%luBytes", n);
ret = gf_asprintf(&str, "%" PRIu64 "Bytes", n);
if (ret < 0)
goto err;
}

View File

@ -2456,7 +2456,7 @@ inode_dump(inode_t *inode, char *prefix)
{
nlookup = GF_ATOMIC_GET(inode->nlookup);
gf_proc_dump_write("gfid", "%s", uuid_utoa(inode->gfid));
gf_proc_dump_write("nlookup", "%ld", nlookup);
gf_proc_dump_write("nlookup", "%" PRIu64, nlookup);
gf_proc_dump_write("fd-count", "%u", inode->fd_count);
gf_proc_dump_write("active-fd-count", "%u", inode->active_fd_count);
gf_proc_dump_write("ref", "%u", inode->ref);

View File

@ -383,7 +383,7 @@ gf_proc_dump_mempool_info(glusterfs_ctx_t *ctx)
gf_proc_dump_write("sizeof-type", "%lu", pool->sizeof_type);
gf_proc_dump_write("padded-sizeof", "%d",
1 << pool->pool->power_of_two);
gf_proc_dump_write("size", "%lu",
gf_proc_dump_write("size", "%" PRId64,
(1 << pool->pool->power_of_two) * active);
gf_proc_dump_write("shared-pool", "%p", pool->pool);
}
@ -461,17 +461,17 @@ gf_proc_dump_latency_info(xlator_t *xl);
void
gf_proc_dump_dict_info(glusterfs_ctx_t *ctx)
{
uint64_t total_dicts = 0;
uint64_t total_pairs = 0;
int64_t total_dicts = 0;
int64_t total_pairs = 0;
total_dicts = GF_ATOMIC_GET(ctx->stats.total_dicts_used);
total_pairs = GF_ATOMIC_GET(ctx->stats.total_pairs_used);
gf_proc_dump_write("max-pairs-per-dict", "%" GF_PRI_ATOMIC,
GF_ATOMIC_GET(ctx->stats.max_dict_pairs));
gf_proc_dump_write("total-pairs-used", "%lu", total_pairs);
gf_proc_dump_write("total-dicts-used", "%lu", total_dicts);
gf_proc_dump_write("average-pairs-per-dict", "%lu",
gf_proc_dump_write("total-pairs-used", "%" PRId64, total_pairs);
gf_proc_dump_write("total-dicts-used", "%" PRId64, total_dicts);
gf_proc_dump_write("average-pairs-per-dict", "%" PRId64,
(total_pairs / total_dicts));
}

View File

@ -152,7 +152,7 @@ dht_priv_dump(xlator_t *this)
gf_proc_dump_write(key, "%lf", conf->du_stats[i].avail_percent);
snprintf(key, sizeof(key), "du_stats[%d].avail_space", i);
gf_proc_dump_write(key, "%lu", conf->du_stats[i].avail_space);
gf_proc_dump_write(key, "%" PRIu64, conf->du_stats[i].avail_space);
snprintf(key, sizeof(key), "du_stats[%d].avail_inodes", i);
gf_proc_dump_write(key, "%lf", conf->du_stats[i].avail_inodes);

View File

@ -732,7 +732,7 @@ barrier_dump_priv(xlator_t *this)
gf_proc_dump_build_key(key, "barrier", "enabled");
gf_proc_dump_write(key, "%d", priv->barrier_enabled);
gf_proc_dump_build_key(key, "barrier", "timeout");
gf_proc_dump_write(key, "%" PRId64, priv->timeout.tv_sec);
gf_proc_dump_write(key, "%ld", priv->timeout.tv_sec);
if (priv->barrier_enabled) {
gf_proc_dump_build_key(key, "barrier", "queue_size");
gf_proc_dump_write(key, "%d", priv->queue_size);

View File

@ -5158,7 +5158,8 @@ quota_priv_dump(xlator_t *this)
gf_proc_dump_write("quota-on", "%d", priv->is_quota_on);
gf_proc_dump_write("statfs", "%d", priv->consider_statfs);
gf_proc_dump_write("volume-uuid", "%s", priv->volume_uuid);
gf_proc_dump_write("validation-count", "%ld", priv->validation_count);
gf_proc_dump_write("validation-count", "%" PRIu64,
priv->validation_count);
}
UNLOCK(&priv->lock);

View File

@ -451,7 +451,7 @@ fuse_invalidate_inode(xlator_t *this, uint64_t fuse_ino)
static int32_t
fuse_inode_invalidate_fn(xlator_t *this, inode_t *inode)
{
fuse_invalidate_entry(this, (uint64_t)inode);
fuse_invalidate_entry(this, (uint64_t)(uintptr_t)inode);
return 0;
}
#endif

View File

@ -432,7 +432,7 @@ nfs_fix_generation(xlator_t *this, inode_t *inode)
priv = this->private;
if (inode_ctx_get(inode, this, &raw_ctx) == 0) {
ictx = (struct nfs_inode_ctx *)raw_ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)raw_ctx;
ictx->generation = priv->generation;
} else {
ictx = GF_CALLOC(1, sizeof(struct nfs_inode_ctx), gf_nfs_mt_inode_ctx);
@ -443,7 +443,7 @@ nfs_fix_generation(xlator_t *this, inode_t *inode)
}
INIT_LIST_HEAD(&ictx->shares);
ictx->generation = priv->generation;
ret = inode_ctx_put(inode, this, (uint64_t)ictx);
ret = inode_ctx_put(inode, this, (uint64_t)(uintptr_t)ictx);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, NFS_MSG_INODE_CTX_STORE_FAIL,
"could not store nfs inode ctx");

View File

@ -1551,7 +1551,7 @@ nfs_forget(xlator_t *this, inode_t *inode)
if (inode_ctx_del(inode, this, &ctx))
return -1;
ictx = (struct nfs_inode_ctx *)ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)ctx;
GF_FREE(ictx);
return 0;

View File

@ -914,7 +914,7 @@ nfs3_getattr_resume(void *carg)
* haven't been validated since the state change are affected.
*/
if (inode_ctx_get(cs->resolvedloc.inode, cs->nfsx, &raw_ctx) == 0) {
ictx = (struct nfs_inode_ctx *)raw_ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)raw_ctx;
priv = cs->nfsx->private;
if (ictx->generation != priv->generation) {
ret = nfs_lookup(cs->nfsx, cs->vol, &nfu, &cs->resolvedloc,
@ -2587,14 +2587,15 @@ nfs3svc_create_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if ((cs->stbuf.ia_mtime == buf->ia_mtime) &&
(cs->stbuf.ia_atime == buf->ia_atime)) {
gf_msg_debug(GF_NFS3, 0, "Create req retransmitted verf %ld %ld",
gf_msg_debug(GF_NFS3, 0,
"Create req retransmitted verf %" PRId64 " %" PRId64,
cs->stbuf.ia_mtime, cs->stbuf.ia_atime);
stat = NFS3_OK;
nfs3_fh_build_child_fh(&cs->parent, buf, &cs->fh);
} else {
gf_msg_debug(GF_NFS3, 0,
"File already exist new_verf %ld %ld"
"old_verf %ld %ld",
"File already exist new_verf %" PRId64 " %" PRId64
"old_verf %" PRId64 " %" PRId64,
cs->stbuf.ia_mtime, cs->stbuf.ia_atime, buf->ia_mtime,
buf->ia_atime);
stat = NFS3ERR_EXIST;

View File

@ -639,7 +639,7 @@ nlm4_file_open_and_resume(nfs3_call_state_t *cs, nlm4_resume_fn_t resume)
goto err;
}
cs->resume_fn = resume;
fd = fd_lookup_uint64(cs->resolvedloc.inode, (uint64_t)nlmclnt);
fd = fd_lookup_uint64(cs->resolvedloc.inode, (uint64_t)(uintptr_t)nlmclnt);
if (fd) {
cs->fd = fd;
cs->resolve_ret = 0;
@ -648,7 +648,7 @@ nlm4_file_open_and_resume(nfs3_call_state_t *cs, nlm4_resume_fn_t resume)
goto err;
}
fd = fd_create_uint64(cs->resolvedloc.inode, (uint64_t)nlmclnt);
fd = fd_create_uint64(cs->resolvedloc.inode, (uint64_t)(uintptr_t)nlmclnt);
if (fd == NULL) {
gf_msg(GF_NLM, GF_LOG_ERROR, ENOLCK, NFS_MSG_NO_MEMORY,
"fd_create_uint64() returned NULL");
@ -1654,7 +1654,8 @@ nlm4_cancel_resume(void *carg)
"nlm_get_uniq() returned NULL");
goto nlm4err;
}
cs->fd = fd_lookup_uint64(cs->resolvedloc.inode, (uint64_t)nlmclnt);
cs->fd = fd_lookup_uint64(cs->resolvedloc.inode,
(uint64_t)(uintptr_t)nlmclnt);
if (cs->fd == NULL) {
gf_msg(GF_NLM, GF_LOG_ERROR, errno, NFS_MSG_FD_LOOKUP_NULL,
"fd_lookup_uint64 retrned NULL");
@ -1814,7 +1815,8 @@ nlm4_unlock_resume(void *carg)
"nlm_get_uniq() returned NULL for %s", caller_name);
goto nlm4err;
}
cs->fd = fd_lookup_uint64(cs->resolvedloc.inode, (uint64_t)nlmclnt);
cs->fd = fd_lookup_uint64(cs->resolvedloc.inode,
(uint64_t)(uintptr_t)nlmclnt);
if (cs->fd == NULL) {
stat = nlm4_granted;
gf_msg(GF_NLM, GF_LOG_WARNING, 0, NFS_MSG_FD_LOOKUP_NULL,
@ -1964,14 +1966,14 @@ nlm4_add_share_to_inode(nlm_share_t *share)
head = &ictx->shares;
INIT_LIST_HEAD(head);
ret = inode_ctx_put(inode, this, (uint64_t)ictx);
ret = inode_ctx_put(inode, this, (uint64_t)(uintptr_t)ictx);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, NFS_MSG_SHARE_LIST_STORE_FAIL,
"could not store share list");
goto out;
}
} else {
ictx = (struct nfs_inode_ctx *)ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)ctx;
head = &ictx->shares;
}
@ -2006,7 +2008,7 @@ nlm4_approve_share_reservation(nfs3_call_state_t *cs)
ret = 0;
goto out;
}
ictx = (struct nfs_inode_ctx *)ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)ctx;
head = &ictx->shares;
if (!head || list_empty(head))
@ -2226,7 +2228,7 @@ nlm4_remove_share_reservation(nfs3_call_state_t *cs)
inode->gfid, caller);
goto out;
}
ictx = (struct nfs_inode_ctx *)ctx;
ictx = (struct nfs_inode_ctx *)(uintptr_t)ctx;
head = &ictx->shares;
if (list_empty(head)) {
@ -2735,7 +2737,7 @@ nlm_priv(xlator_t *this)
file_count = 0;
list_for_each_entry(fde, &client->fdes, fde_list)
{
gf_proc_dump_build_key(key, "file", "%ld.gfid", file_count);
gf_proc_dump_build_key(key, "file", "%" PRIu64 ".gfid", file_count);
memset(gfid_str, 0, 64);
uuid_utoa_r(fde->fd->inode->gfid, gfid_str);
gf_proc_dump_write(key, "%s", gfid_str);
@ -2743,7 +2745,7 @@ nlm_priv(xlator_t *this)
}
gf_proc_dump_build_key(key, "client", "files-locked");
gf_proc_dump_write(key, "%ld\n", file_count);
gf_proc_dump_write(key, "%" PRIu64 "\n", file_count);
client_count++;
}

View File

@ -2105,9 +2105,9 @@ ioc_priv_dump(xlator_t *this)
if (ret)
goto out;
{
gf_proc_dump_write("page_size", "%ld", priv->page_size);
gf_proc_dump_write("cache_size", "%ld", priv->cache_size);
gf_proc_dump_write("cache_used", "%ld", priv->cache_used);
gf_proc_dump_write("page_size", "%" PRIu64, priv->page_size);
gf_proc_dump_write("cache_size", "%" PRIu64, priv->cache_size);
gf_proc_dump_write("cache_used", "%" PRIu64, priv->cache_used);
gf_proc_dump_write("inode_count", "%u", priv->inode_count);
gf_proc_dump_write("cache_timeout", "%u", priv->cache_timeout);
gf_proc_dump_write("min-file-size", "%" PRIu64, priv->min_file_size);

View File

@ -1176,7 +1176,7 @@ nlc_dump_inodectx(xlator_t *this, inode_t *inode)
gf_proc_dump_write("state", "%" PRIu64, nlc_ctx->state);
gf_proc_dump_write("timer", "%p", nlc_ctx->timer);
gf_proc_dump_write("cache-time", "%" GF_PRI_TIME, nlc_ctx->cache_time);
gf_proc_dump_write("cache-time", "%ld", nlc_ctx->cache_time);
gf_proc_dump_write("cache-size", "%zu", nlc_ctx->cache_size);
gf_proc_dump_write("refd-inodes", "%" PRIu64, nlc_ctx->refd_inodes);

View File

@ -223,7 +223,7 @@ rda_mark_inode_dirty(xlator_t *this, inode_t *inode)
if (val == 0)
continue;
fd_ctx = (void *)val;
fd_ctx = (void *)(uintptr_t)val;
uuid_utoa_r(inode->gfid, gfid);
if (!GF_ATOMIC_GET(fd_ctx->prefetching))
continue;

View File

@ -127,7 +127,7 @@ posix_priv(xlator_t *this)
gf_proc_dump_write("base_path_length", "%d", priv->base_path_length);
gf_proc_dump_write("max_read", "%" PRId64, priv->read_value);
gf_proc_dump_write("max_write", "%" PRId64, priv->write_value);
gf_proc_dump_write("nr_files", "%ld", priv->nr_files);
gf_proc_dump_write("nr_files", "%" PRId64, priv->nr_files);
return 0;
}