From 2d96ce8faa277809c0c94aca54320483889f577d Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Tue, 25 Sep 2018 13:22:47 +0200 Subject: all: fix warnings on non 64-bits architectures When compiling in other architectures there appear many warnings. Some of them are actual problems that prevent gluster to work correctly on those architectures. Change-Id: Icdc7107a2bc2da662903c51910beddb84bdf03c0 fixes: bz#1632717 Signed-off-by: Xavi Hernandez --- xlators/storage/bd/src/bd-helper.c | 2 +- xlators/storage/bd/src/bd.c | 6 +++--- xlators/storage/posix/src/posix-helpers.c | 2 +- xlators/storage/posix/src/posix-inode-fd-ops.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/bd/src/bd-helper.c b/xlators/storage/bd/src/bd-helper.c index 895c6500acf..c6891749008 100644 --- a/xlators/storage/bd/src/bd-helper.c +++ b/xlators/storage/bd/src/bd-helper.c @@ -331,7 +331,7 @@ bd_validate_bd_xattr(xlator_t *this, char *bd, char **type, uint64_t *lv_size, if (bytes) { *bytes = '\0'; bytes++; - gf_string2bytesize(bytes, &size); + gf_string2bytesize_uint64(bytes, &size); } if (strcmp(bd, BD_LV) && strcmp(bd, BD_THIN)) { diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c index 0b399157238..0a29a99181b 100644 --- a/xlators/storage/bd/src/bd.c +++ b/xlators/storage/bd/src/bd.c @@ -1025,7 +1025,7 @@ bd_setx_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, if (!s_size) size = bd_get_default_extent(priv); else - gf_string2bytesize(s_size, &size); + gf_string2bytesize_uint64(s_size, &size); gf_asprintf(&bd, "%s:%ld", type, size); BD_VALIDATE_MEM_ALLOC(bd, op_errno, out); @@ -1146,7 +1146,7 @@ bd_offload_getx_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* For clone size is taken from source LV */ if (!local->size) { p++; - gf_string2bytesize(p, &local->size); + gf_string2bytesize_uint64(p, &local->size); } gf_asprintf(&bd, "%s:%ld", type, local->size); local->bdatt->type = gf_strdup(type); @@ -1312,7 +1312,7 @@ bd_offload(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, gfid = strtok_r(param, ":", &p); size = strtok_r(NULL, ":", &p); if (size) - gf_string2bytesize(size, &local->size); + gf_string2bytesize_uint64(size, &local->size); else if (offload != BD_OF_CLONE) local->size = bd_get_default_extent(this->private); diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 99ee094c114..4c3f064f564 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2582,7 +2582,7 @@ __posix_inode_ctx_get(inode_t *inode, xlator_t *this) ret = __inode_ctx_get(inode, this, &ctx_uint); if (ret == 0) { - return (posix_inode_ctx_t *)ctx_uint; + return (posix_inode_ctx_t *)(uintptr_t)ctx_uint; } ctx_p = GF_CALLOC(1, sizeof(*ctx_p), gf_posix_mt_inode_ctx_t); diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 4b6716fcd7f..4ce181d9c0e 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -2337,7 +2337,7 @@ posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, goto unlock; } - sprintf(stime, "%lu", tmp_stbuf.ia_mtime); + sprintf(stime, "%" PRId64, tmp_stbuf.ia_mtime); /*TODO: may be should consider nano-second also */ if (strncmp(stime, tdata->data, tdata->len) != 0) { @@ -2350,7 +2350,7 @@ posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, goto unlock; } - len = sprintf(sxattr, "%lu", tmp_stbuf.ia_size); + len = sprintf(sxattr, "%" PRIu64, tmp_stbuf.ia_size); ret = sys_lsetxattr(real_path, GF_CS_OBJECT_SIZE, sxattr, len, flags); @@ -5400,7 +5400,7 @@ posix_forget(xlator_t *this, inode_t *inode) if (!ctx_uint) return 0; - ctx = (posix_inode_ctx_t *)ctx_uint; + ctx = (posix_inode_ctx_t *)(uintptr_t)ctx_uint; if (ctx->unlink_flag == GF_UNLINK_TRUE) { POSIX_GET_FILE_UNLINK_PATH(priv_posix->base_path, inode->gfid, -- cgit