summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-helper.c')
-rw-r--r--xlators/cluster/dht/src/dht-helper.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index e463aad3a0c..4764ac5fdd3 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -34,7 +34,7 @@ dht_fd_ctx_destroy(xlator_t *this, fd_t *fd)
goto out;
}
- fd_ctx = (dht_fd_ctx_t *)value;
+ fd_ctx = (dht_fd_ctx_t *)(uintptr_t)value;
if (fd_ctx) {
GF_REF_PUT(fd_ctx);
}
@@ -58,10 +58,10 @@ __dht_fd_ctx_set(xlator_t *this, fd_t *fd, xlator_t *dst)
goto out;
}
- fd_ctx->opened_on_dst = (uint64_t)dst;
+ fd_ctx->opened_on_dst = (uint64_t)(uintptr_t)dst;
GF_REF_INIT(fd_ctx, dht_free_fd_ctx);
- value = (uint64_t)fd_ctx;
+ value = (uint64_t)(uintptr_t)fd_ctx;
ret = __fd_ctx_set(fd, this, value);
if (ret < 0) {
@@ -87,8 +87,8 @@ dht_fd_ctx_set(xlator_t *this, fd_t *fd, xlator_t *dst)
{
ret = __fd_ctx_get(fd, this, &value);
if (ret && value) {
- fd_ctx = (dht_fd_ctx_t *)value;
- if (fd_ctx->opened_on_dst == (uint64_t)dst) {
+ fd_ctx = (dht_fd_ctx_t *)(uintptr_t)value;
+ if (fd_ctx->opened_on_dst == (uint64_t)(uintptr_t)dst) {
/* This could happen due to racing
* check_progress tasks*/
goto unlock;
@@ -98,7 +98,7 @@ dht_fd_ctx_set(xlator_t *this, fd_t *fd, xlator_t *dst)
"Different dst found in the fd ctx");
/* Overwrite and hope for the best*/
- fd_ctx->opened_on_dst = (uint64_t)dst;
+ fd_ctx->opened_on_dst = (uint64_t)(uintptr_t)dst;
goto unlock;
}
}
@@ -128,7 +128,7 @@ dht_fd_ctx_get(xlator_t *this, fd_t *fd)
goto out;
}
- fd_ctx = (dht_fd_ctx_t *)tmp_val;
+ fd_ctx = (dht_fd_ctx_t *)(uintptr_t)tmp_val;
GF_REF_GET(fd_ctx);
}
UNLOCK(&fd->lock);
@@ -146,7 +146,7 @@ dht_fd_open_on_dst(xlator_t *this, fd_t *fd, xlator_t *dst)
fd_ctx = dht_fd_ctx_get(this, fd);
if (fd_ctx) {
- if (fd_ctx->opened_on_dst == (uint64_t)dst) {
+ if (fd_ctx->opened_on_dst == (uint64_t)(uintptr_t)dst) {
opened = _gf_true;
}
GF_REF_PUT(fd_ctx);
@@ -182,7 +182,7 @@ dht_inode_ctx_set_mig_info(xlator_t *this, inode_t *inode, xlator_t *src_subvol,
miginfo->dst_subvol = dst_subvol;
GF_REF_INIT(miginfo, dht_free_mig_info);
- value = (uint64_t)miginfo;
+ value = (uint64_t)(uintptr_t)miginfo;
ret = inode_ctx_set1(inode, this, &value);
if (ret < 0) {
@@ -209,7 +209,7 @@ dht_inode_ctx_get_mig_info(xlator_t *this, inode_t *inode,
goto out;
}
- miginfo = (dht_migrate_info_t *)tmp_miginfo;
+ miginfo = (dht_migrate_info_t *)(uintptr_t)tmp_miginfo;
GF_REF_GET(miginfo);
}
UNLOCK(&inode->lock);
@@ -1310,7 +1310,7 @@ dht_migration_complete_check_task(void *data)
"%s: Found miginfo in the inode ctx",
tmp_loc.path ? tmp_loc.path : uuid_utoa(tmp_loc.gfid));
- miginfo = (void *)tmp_miginfo;
+ miginfo = (void *)(uintptr_t)tmp_miginfo;
GF_REF_PUT(miginfo);
}
ret = 1;
@@ -1371,7 +1371,7 @@ dht_migration_complete_check_task(void *data)
done on all the fd of inode */
ret = inode_ctx_reset1(inode, this, &tmp_miginfo);
if (tmp_miginfo) {
- miginfo = (void *)tmp_miginfo;
+ miginfo = (void *)(uintptr_t)tmp_miginfo;
GF_REF_PUT(miginfo);
goto out;
}
@@ -1578,7 +1578,7 @@ dht_rebalance_inprogress_task(void *data)
gf_msg(this->name, GF_LOG_WARNING, 0, DHT_MSG_HAS_MIGINFO,
"%s: Found miginfo in the inode ctx",
tmp_loc.path ? tmp_loc.path : uuid_utoa(tmp_loc.gfid));
- miginfo = (void *)tmp_miginfo;
+ miginfo = (void *)(uintptr_t)tmp_miginfo;
GF_REF_PUT(miginfo);
}
ret = 1;
@@ -1830,7 +1830,7 @@ dht_inode_ctx_get(inode_t *inode, xlator_t *this, dht_inode_ctx_t **ctx)
return ret;
if (ctx)
- *ctx = (dht_inode_ctx_t *)ctx_int;
+ *ctx = (dht_inode_ctx_t *)(uintptr_t)ctx_int;
out:
return ret;
}
@@ -2072,7 +2072,7 @@ __dht_lock_subvol_set(inode_t *inode, xlator_t *this, xlator_t *lock_subvol)
return -1;
}
- ctx = (dht_inode_ctx_t *)value;
+ ctx = (dht_inode_ctx_t *)(uintptr_t)value;
ctx->lock_subvol = lock_subvol;
out:
return ret;
@@ -2127,7 +2127,7 @@ dht_get_lock_subvolume(xlator_t *this, struct gf_flock *lock,
LOCK(&inode->lock);
ret = __inode_ctx_get0(inode, this, &value);
if (!ret && value) {
- ctx = (dht_inode_ctx_t *)value;
+ ctx = (dht_inode_ctx_t *)(uintptr_t)value;
subvol = ctx->lock_subvol;
}
if (!subvol && lock->l_type != F_UNLCK && cached_subvol) {