summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-common.c31
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c25
-rw-r--r--xlators/cluster/dht/src/dht-common.c2
-rw-r--r--xlators/cluster/dht/src/dht-helper.c32
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c11
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c5
-rw-r--r--xlators/cluster/dht/src/tier.c6
-rw-r--r--xlators/cluster/ec/src/ec-combine.c7
-rw-r--r--xlators/cluster/ec/src/ec-common.c49
-rw-r--r--xlators/cluster/ec/src/ec-common.h7
-rw-r--r--xlators/cluster/ec/src/ec-dir-read.c5
-rw-r--r--xlators/cluster/ec/src/ec-generic.c11
-rw-r--r--xlators/cluster/ec/src/ec-heal.c4
-rw-r--r--xlators/cluster/ec/src/ec-inode-read.c19
-rw-r--r--xlators/cluster/ec/src/ec-inode-write.c36
-rw-r--r--xlators/cluster/ec/src/ec-method.c8
-rw-r--r--xlators/cluster/ec/src/ec-method.h4
-rw-r--r--xlators/cluster/ec/src/ec.c2
-rw-r--r--xlators/cluster/stripe/src/stripe-helpers.c2
-rw-r--r--xlators/cluster/stripe/src/stripe.c2
20 files changed, 142 insertions, 126 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index a0ff6acd9dd..8d50144c046 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -148,7 +148,7 @@ __afr_inode_ctx_get(xlator_t *this, inode_t *inode, afr_inode_ctx_t **ctx)
ret = __inode_ctx_get(inode, this, &ctx_int);
if (ret == 0) {
- *ctx = (afr_inode_ctx_t *)ctx_int;
+ *ctx = (afr_inode_ctx_t *)(uintptr_t)ctx_int;
return 0;
}
@@ -174,7 +174,7 @@ __afr_inode_ctx_get(xlator_t *this, inode_t *inode, afr_inode_ctx_t **ctx)
INIT_LIST_HEAD(&lock->owners);
}
- ctx_int = (uint64_t)ictx;
+ ctx_int = (uint64_t)(uintptr_t)ictx;
ret = __inode_ctx_set(inode, this, &ctx_int);
if (ret) {
goto out;
@@ -4842,7 +4842,7 @@ afr_forget(xlator_t *this, inode_t *inode)
if (!ctx_int)
return 0;
- ctx = (afr_inode_ctx_t *)ctx_int;
+ ctx = (afr_inode_ctx_t *)(uintptr_t)ctx_int;
afr_inode_ctx_destroy(ctx);
return 0;
}
@@ -5042,8 +5042,7 @@ find_best_down_child(xlator_t *this)
}
if (best_child >= 0) {
gf_msg_debug(this->name, 0,
- "Found best down child (%d) "
- "@ %ld ms latency",
+ "Found best down child (%d) @ %" PRId64 " ms latency",
best_child, best_latency);
}
return best_child;
@@ -5068,8 +5067,7 @@ find_worst_up_child(xlator_t *this)
}
if (worst_child >= 0) {
gf_msg_debug(this->name, 0,
- "Found worst up child (%d)"
- " @ %ld ms latency",
+ "Found worst up child (%d) @ %" PRId64 " ms latency",
worst_child, worst_latency);
}
return worst_child;
@@ -5086,7 +5084,7 @@ __afr_handle_ping_event(xlator_t *this, xlator_t *child_xlator, const int idx,
priv = this->private;
priv->child_latency[idx] = child_latency_msec;
- gf_msg_debug(child_xlator->name, 0, "Client ping @ %ld ms",
+ gf_msg_debug(child_xlator->name, 0, "Client ping @ %" PRId64 " ms",
child_latency_msec);
if (priv->shd.iamshd)
return;
@@ -5102,8 +5100,10 @@ __afr_handle_ping_event(xlator_t *this, xlator_t *child_xlator, const int idx,
priv->halo_min_replicas);
} else {
gf_log(child_xlator->name, GF_LOG_INFO,
- "Child latency (%ld ms) "
- "exceeds halo threshold (%ld), "
+ "Child latency (%" PRId64
+ " ms) "
+ "exceeds halo threshold (%" PRId64
+ "), "
"marking child down.",
child_latency_msec, halo_max_latency_msec);
*event = GF_EVENT_CHILD_DOWN;
@@ -5112,8 +5112,10 @@ __afr_handle_ping_event(xlator_t *this, xlator_t *child_xlator, const int idx,
priv->child_up[idx] == 0) {
if (up_children < priv->halo_max_replicas) {
gf_log(child_xlator->name, GF_LOG_INFO,
- "Child latency (%ld ms) "
- "below halo threshold (%ld), "
+ "Child latency (%" PRId64
+ " ms) "
+ "below halo threshold (%" PRId64
+ "), "
"marking child up.",
child_latency_msec, halo_max_latency_msec);
*event = GF_EVENT_CHILD_UP;
@@ -5141,7 +5143,7 @@ afr_get_halo_latency(xlator_t *this)
} else {
halo_max_latency_msec = priv->halo_max_latency_msec;
}
- gf_msg_debug(this->name, 0, "Using halo latency %ld",
+ gf_msg_debug(this->name, 0, "Using halo latency %" PRId64,
halo_max_latency_msec);
return halo_max_latency_msec;
}
@@ -5196,7 +5198,8 @@ __afr_handle_child_up_event(xlator_t *this, xlator_t *child_xlator,
priv->child_latency[worst_up_child] > halo_max_latency_msec) {
gf_msg_debug(this->name, 0,
"Marking child %d down, "
- "doesn't meet halo threshold (%ld), and > "
+ "doesn't meet halo threshold (%" PRId64
+ "), and > "
"halo_min_replicas (%d)",
worst_up_child, halo_max_latency_msec,
priv->halo_min_replicas);
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 402f5ea5888..8635b3e9e06 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1040,8 +1040,8 @@ afr_sh_fav_by_majority(xlator_t *this, struct afr_reply *replies,
for (i = 0; i < priv->child_count; i++) {
if (replies[i].valid == 1) {
gf_msg_debug(this->name, 0,
- "Child:%s "
- "mtime_sec = %ld, size = %lu for gfid %s",
+ "Child:%s mtime_sec = %" PRId64 ", size = %" PRIu64
+ " for gfid %s",
priv->children[i]->name, replies[i].poststat.ia_mtime,
replies[i].poststat.ia_size, uuid_utoa(inode->gfid));
vote_count = 0;
@@ -1079,8 +1079,9 @@ afr_sh_fav_by_mtime(xlator_t *this, struct afr_reply *replies, inode_t *inode)
for (i = 0; i < priv->child_count; i++) {
if (replies[i].valid == 1) {
gf_msg_debug(this->name, 0,
- "Child:%s "
- "mtime = %ld, mtime_nsec = %d for gfid %s",
+ "Child:%s mtime = %" PRId64
+ ", mtime_nsec = %d for "
+ "gfid %s",
priv->children[i]->name, replies[i].poststat.ia_mtime,
replies[i].poststat.ia_mtime_nsec,
uuid_utoa(inode->gfid));
@@ -1116,8 +1117,9 @@ afr_sh_fav_by_ctime(xlator_t *this, struct afr_reply *replies, inode_t *inode)
for (i = 0; i < priv->child_count; i++) {
if (replies[i].valid == 1) {
gf_msg_debug(this->name, 0,
- "Child:%s "
- "ctime = %ld, ctime_nsec = %d for gfid %s",
+ "Child:%s ctime = %" PRId64
+ ", ctime_nsec = %d for "
+ "gfid %s",
priv->children[i]->name, replies[i].poststat.ia_ctime,
replies[i].poststat.ia_ctime_nsec,
uuid_utoa(inode->gfid));
@@ -1152,8 +1154,7 @@ afr_sh_fav_by_size(xlator_t *this, struct afr_reply *replies, inode_t *inode)
for (i = 0; i < priv->child_count; i++) {
if (replies[i].valid == 1) {
gf_msg_debug(this->name, 0,
- "Child:%s "
- "file size = %lu for gfid %s",
+ "Child:%s file size = %" PRIu64 " for gfid %s",
priv->children[i]->name, replies[i].poststat.ia_size,
uuid_utoa(inode->gfid));
if (replies[i].poststat.ia_size > cmp_sz) {
@@ -1241,10 +1242,10 @@ afr_mark_split_brain_source_sinks_by_policy(
strftime(ctime_str, sizeof(ctime_str), "%Y-%m-%d %H:%M:%S", tm_ptr);
gf_msg(this->name, GF_LOG_WARNING, 0, AFR_MSG_SBRAIN_FAV_CHILD_POLICY,
- "Source %s "
- "selected as authentic to resolve conflicting "
- "data in file (gfid:%s) by %s (%lu bytes @ %s mtime, "
- "%s ctime).",
+ "Source %s selected as authentic to resolve conflicting data "
+ "in file (gfid:%s) by %s (%" PRIu64
+ " bytes @ %s mtime, %s "
+ "ctime).",
priv->children[fav_child]->name, uuid_utoa(inode->gfid),
policy_str, replies[fav_child].poststat.ia_size, mtime_str,
ctime_str);
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 0f668e67793..a94f904323c 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -440,7 +440,7 @@ dht_inode_ctx_mdsvol_set(inode_t *inode, xlator_t *this, xlator_t *mds_subvol)
{
ret = __inode_ctx_get(inode, this, &ctx_int);
if (ctx_int) {
- ctx = (dht_inode_ctx_t *)ctx_int;
+ ctx = (dht_inode_ctx_t *)(uintptr_t)ctx_int;
ctx->mds_subvol = mds_subvol;
} else {
ctx = GF_CALLOC(1, sizeof(*ctx), gf_dht_mt_inode_ctx_t);
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) {
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 7a2539dc5f5..c9f41442f15 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -941,8 +941,8 @@ __dht_check_free_space(xlator_t *this, xlator_t *to, xlator_t *from, loc_t *loc,
}
gf_msg_debug(this->name, 0,
- "min_free_disk - %f , block available - "
- "%lu , block size - %lu ",
+ "min_free_disk - %f , block available - %" PRId64
+ ", block size - %lu",
conf->min_free_disk, dst_statfs.f_bavail, dst_statfs.f_bsize);
dst_statfs_blocks = dst_statfs.f_bavail *
@@ -1018,7 +1018,7 @@ check_avail_space:
gf_msg_debug(this->name, 0,
"file : %s, post_availspacepercent"
- " : %lf f_bavail : %lu min-free-disk: %lf",
+ " : %lf f_bavail : %" PRIu64 " min-free-disk: %lf",
loc->path, dst_post_availspacepercent, dst_statfs.f_bavail,
conf->min_free_disk);
@@ -1039,9 +1039,8 @@ check_avail_space:
if (conf->disk_unit != 'p') {
if ((dst_statfs_blocks * GF_DISK_SECTOR_SIZE) < conf->min_free_disk) {
gf_msg_debug(this->name, 0,
- "file : %s, destination "
- "frsize: %lu f_bavail : %lu "
- "min-free-disk: %lf",
+ "file : %s, destination frsize: %lu "
+ "f_bavail : %" PRIu64 " min-free-disk: %lf",
loc->path, dst_statfs.f_frsize, dst_statfs.f_bavail,
conf->min_free_disk);
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index fab970be394..0e57eab5f7f 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -1899,8 +1899,9 @@ dht_selfheal_layout_new_directory(call_frame_t *frame, loc_t *loc,
if (weight_by_size && total_size) {
/* We know total_size is not zero. */
chunk = ((double)0xffffffff) / ((double)total_size);
- gf_msg_debug(this->name, 0, "chunk size = 0xffffffff / %lu = %f",
- total_size, chunk);
+ gf_msg_debug(this->name, 0,
+ "chunk size = 0xffffffff / %" PRIu64 " = %f", total_size,
+ chunk);
} else {
weight_by_size = _gf_false;
chunk = ((unsigned long)0xffffffff) / bricks_to_use;
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index f7fd6ef22e2..584f1dd76ba 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -478,7 +478,8 @@ tier_can_promote_file(xlator_t *this, char const *file_name,
if (defrag->tier_conf.tier_max_promote_size &&
(current->ia_size > defrag->tier_conf.tier_max_promote_size)) {
gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_LOG_TIER_STATUS,
- "File %s (gfid:%s) with size (%lu) exceeds maxsize "
+ "File %s (gfid:%s) with size (%" PRIu64
+ ") exceeds maxsize "
"(%d) for promotion. File will not be promoted.",
file_name, uuid_utoa(current->ia_gfid), current->ia_size,
defrag->tier_conf.tier_max_promote_size);
@@ -505,7 +506,8 @@ tier_can_promote_file(xlator_t *this, char const *file_name,
defrag->tier_conf.watermark_hi) {
gf_msg(this->name, GF_LOG_INFO, 0, DHT_MSG_LOG_TIER_STATUS,
"Estimated block count consumption on "
- "hot tier (%lu) exceeds hi watermark (%d%%). "
+ "hot tier (%" PRIu64
+ ") exceeds hi watermark (%d%%). "
"File will not be promoted.",
estimated_usage, defrag->tier_conf.watermark_hi);
goto err;
diff --git a/xlators/cluster/ec/src/ec-combine.c b/xlators/cluster/ec/src/ec-combine.c
index 2e5111b38f8..454c2c72c95 100644
--- a/xlators/cluster/ec/src/ec-combine.c
+++ b/xlators/cluster/ec/src/ec-combine.c
@@ -174,8 +174,11 @@ ec_iatt_combine(ec_fop_data_t *fop, struct iatt *dst, struct iatt *src,
}
if (failed) {
gf_msg(fop->xl->name, GF_LOG_WARNING, 0, EC_MSG_IATT_COMBINE_FAIL,
- "Failed to combine iatt (inode: %lu-%lu, links: %u-%u, "
- "uid: %u-%u, gid: %u-%u, rdev: %lu-%lu, size: %lu-%lu, "
+ "Failed to combine iatt (inode: %" PRIu64 "-%" PRIu64
+ ", "
+ "links: %u-%u, uid: %u-%u, gid: %u-%u, "
+ "rdev: %" PRIu64 "-%" PRIu64 ", size: %" PRIu64 "-%" PRIu64
+ ", "
"mode: %o-%o)",
dst[i].ia_ino, src[i].ia_ino, dst[i].ia_nlink,
src[i].ia_nlink, dst[i].ia_uid, src[i].ia_uid, dst[i].ia_gid,
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index 0eee0a3363f..737f7fda882 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -132,22 +132,23 @@ out:
loc_wipe(&loc);
}
-off_t
-ec_range_end_get(off_t fl_start, size_t fl_size)
-{
- off_t fl_end = 0;
- switch (fl_size) {
- case 0:
- return fl_start;
- case LLONG_MAX: /*Infinity*/
- return LLONG_MAX;
- default:
- fl_end = fl_start + fl_size - 1;
- if (fl_end < 0) /*over-flow*/
- return LLONG_MAX;
- else
- return fl_end;
+static off_t
+ec_range_end_get(off_t fl_start, uint64_t fl_size)
+{
+ if (fl_size > 0) {
+ if (fl_size >= EC_RANGE_FULL) {
+ /* Infinity */
+ fl_start = LLONG_MAX;
+ } else {
+ fl_start += fl_size - 1;
+ if (fl_start < 0) {
+ /* Overflow */
+ fl_start = LLONG_MAX;
+ }
+ }
}
+
+ return fl_start;
}
static gf_boolean_t
@@ -648,7 +649,7 @@ ec_child_select(ec_fop_data_t *fop)
if ((fop->mask & ~ec->xl_up) != 0) {
gf_msg(fop->xl->name, GF_LOG_WARNING, 0, EC_MSG_OP_EXEC_UNAVAIL,
"Executing operation with "
- "some subvolumes unavailable. (%lX). %s ",
+ "some subvolumes unavailable. (%" PRIXPTR "). %s ",
fop->mask & ~ec->xl_up, ec_msg_str(fop));
fop->mask &= ec->xl_up;
}
@@ -870,7 +871,7 @@ ec_lock_allocate(ec_fop_data_t *fop, loc_t *loc)
lock = mem_get0(ec->lock_pool);
if (lock != NULL) {
- lock->good_mask = -1ULL;
+ lock->good_mask = UINTPTR_MAX;
INIT_LIST_HEAD(&lock->owners);
INIT_LIST_HEAD(&lock->waiting);
INIT_LIST_HEAD(&lock->frozen);
@@ -903,9 +904,9 @@ ec_lock_compare(ec_lock_t *lock1, ec_lock_t *lock2)
return gf_uuid_compare(lock1->loc.gfid, lock2->loc.gfid);
}
-void
+static void
ec_lock_insert(ec_fop_data_t *fop, ec_lock_t *lock, uint32_t flags, loc_t *base,
- off_t fl_start, size_t fl_size)
+ off_t fl_start, uint64_t fl_size)
{
ec_lock_link_t *link;
@@ -945,9 +946,9 @@ ec_lock_insert(ec_fop_data_t *fop, ec_lock_t *lock, uint32_t flags, loc_t *base,
lock->refs_pending++;
}
-void
+static void
ec_lock_prepare_inode_internal(ec_fop_data_t *fop, loc_t *loc, uint32_t flags,
- loc_t *base, off_t fl_start, size_t fl_size)
+ loc_t *base, off_t fl_start, uint64_t fl_size)
{
ec_lock_t *lock = NULL;
ec_inode_t *ctx;
@@ -1019,7 +1020,7 @@ unlock:
void
ec_lock_prepare_inode(ec_fop_data_t *fop, loc_t *loc, uint32_t flags,
- off_t fl_start, size_t fl_size)
+ off_t fl_start, uint64_t fl_size)
{
ec_lock_prepare_inode_internal(fop, loc, flags, NULL, fl_start, fl_size);
}
@@ -1048,14 +1049,14 @@ ec_lock_prepare_parent_inode(ec_fop_data_t *fop, loc_t *loc, loc_t *base,
base = NULL;
}
- ec_lock_prepare_inode_internal(fop, &tmp, flags, base, 0, LLONG_MAX);
+ ec_lock_prepare_inode_internal(fop, &tmp, flags, base, 0, EC_RANGE_FULL);
loc_wipe(&tmp);
}
void
ec_lock_prepare_fd(ec_fop_data_t *fop, fd_t *fd, uint32_t flags, off_t fl_start,
- size_t fl_size)
+ uint64_t fl_size)
{
loc_t loc;
int32_t err;
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h
index bea0c045a47..bf41c0086f8 100644
--- a/xlators/cluster/ec/src/ec-common.h
+++ b/xlators/cluster/ec/src/ec-common.h
@@ -95,6 +95,9 @@ enum _ec_xattrop_flags {
#define EC_STATE_HEAL_POST_INODELK_UNLOCK 217
#define EC_STATE_HEAL_DISPATCH 218
+/* Value to cover the full range of a file */
+#define EC_RANGE_FULL ((uint64_t)LLONG_MAX + 1)
+
gf_boolean_t
ec_dispatch_one_retry(ec_fop_data_t *fop, ec_cbk_data_t **cbk);
void
@@ -120,13 +123,13 @@ ec_cbk_set_error(ec_cbk_data_t *cbk, int32_t error, gf_boolean_t ro);
void
ec_lock_prepare_inode(ec_fop_data_t *fop, loc_t *loc, uint32_t flags,
- off_t fl_start, size_t fl_size);
+ off_t fl_start, uint64_t fl_size);
void
ec_lock_prepare_parent_inode(ec_fop_data_t *fop, loc_t *loc, loc_t *base,
uint32_t flags);
void
ec_lock_prepare_fd(ec_fop_data_t *fop, fd_t *fd, uint32_t flags, off_t fl_start,
- size_t fl_size);
+ uint64_t fl_size);
void
ec_lock(ec_fop_data_t *fop);
void
diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c
index 8db92b9d92d..ec4cefb1e78 100644
--- a/xlators/cluster/ec/src/ec-dir-read.c
+++ b/xlators/cluster/ec/src/ec-dir-read.c
@@ -142,7 +142,7 @@ ec_manager_opendir(ec_fop_data_t *fop, int32_t state)
case EC_STATE_LOCK:
ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -427,7 +427,8 @@ ec_manager_readdir(ec_fop_data_t *fop, int32_t state)
}
fop->mask &= 1ULL << idx;
} else {
- ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0,
+ EC_RANGE_FULL);
ec_lock(fop);
}
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c
index d12481bdc18..89e72540916 100644
--- a/xlators/cluster/ec/src/ec-generic.c
+++ b/xlators/cluster/ec/src/ec-generic.c
@@ -83,7 +83,7 @@ ec_manager_flush(ec_fop_data_t *fop, int32_t state)
switch (state) {
case EC_STATE_INIT:
case EC_STATE_LOCK:
- ec_lock_prepare_fd(fop, fop->fd, 0, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, 0, 0, EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -289,7 +289,7 @@ ec_manager_fsync(ec_fop_data_t *fop, int32_t state)
switch (state) {
case EC_STATE_INIT:
case EC_STATE_LOCK:
- ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0, EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -484,7 +484,7 @@ ec_manager_fsyncdir(ec_fop_data_t *fop, int32_t state)
switch (state) {
case EC_STATE_INIT:
case EC_STATE_LOCK:
- ec_lock_prepare_fd(fop, fop->fd, 0, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, 0, 0, EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -1182,9 +1182,10 @@ ec_manager_xattrop(ec_fop_data_t *fop, int32_t state)
case EC_STATE_LOCK:
if (fop->fd == NULL) {
ec_lock_prepare_inode(fop, &fop->loc[0], EC_UPDATE_META, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
} else {
- ec_lock_prepare_fd(fop, fop->fd, EC_UPDATE_META, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, EC_UPDATE_META, 0,
+ EC_RANGE_FULL);
}
ec_lock(fop);
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
index 229c0683d91..9eb5b856932 100644
--- a/xlators/cluster/ec/src/ec-heal.c
+++ b/xlators/cluster/ec/src/ec-heal.c
@@ -332,7 +332,7 @@ ec_fheal(call_frame_t *frame, xlator_t *this, uintptr_t target, int32_t minimum,
ec_fd_t *ctx = ec_fd_get(fd, this);
if (ctx != NULL) {
- gf_msg_trace("ec", 0, "FHEAL ctx: flags=%X, open=%lX", ctx->flags,
+ gf_msg_trace("ec", 0, "FHEAL ctx: flags=%X, open=%" PRIXPTR, ctx->flags,
ctx->open);
ec_heal(frame, this, target, minimum, func, data, &ctx->loc, partial,
xdata);
@@ -2484,7 +2484,7 @@ ec_heal_do(xlator_t *this, void *data, loc_t *loc, int32_t partial)
if (ret == 0) {
gf_msg_debug(this->name, 0,
"%s: name heal "
- "successful on %lX",
+ "successful on %" PRIXPTR,
loc->path,
ec_char_array_to_mask(participants, ec->nodes));
} else {
diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c
index 7a8b174bbed..c02d5401439 100644
--- a/xlators/cluster/ec/src/ec-inode-read.c
+++ b/xlators/cluster/ec/src/ec-inode-read.c
@@ -74,7 +74,7 @@ ec_manager_access(ec_fop_data_t *fop, int32_t state)
case EC_STATE_INIT:
case EC_STATE_LOCK:
ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -301,10 +301,10 @@ ec_manager_getxattr(ec_fop_data_t *fop, int32_t state)
SLEN(GF_XATTR_CLRLK_CMD)) != 0)) {
if (fop->fd == NULL) {
ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
} else {
ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
}
ec_lock(fop);
}
@@ -1008,7 +1008,7 @@ ec_manager_readlink(ec_fop_data_t *fop, int32_t state)
case EC_STATE_INIT:
case EC_STATE_LOCK:
ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -1131,7 +1131,7 @@ ec_readv_rebuild(ec_t *ec, ec_fop_data_t *fop, ec_cbk_data_t *cbk)
ec_cbk_data_t *ans = NULL;
struct iobref *iobref = NULL;
void *ptr;
- size_t fsize = 0, size = 0, max = 0;
+ uint64_t fsize = 0, size = 0, max = 0;
int32_t pos, err = -ENOMEM;
if (cbk->op_ret < 0) {
@@ -1536,7 +1536,7 @@ int32_t
ec_manager_seek(ec_fop_data_t *fop, int32_t state)
{
ec_cbk_data_t *cbk;
- size_t size;
+ uint64_t size;
switch (state) {
case EC_STATE_INIT:
@@ -1548,7 +1548,7 @@ ec_manager_seek(ec_fop_data_t *fop, int32_t state)
case EC_STATE_LOCK:
ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, fop->offset,
- LLONG_MAX);
+ EC_RANGE_FULL);
ec_lock(fop);
return EC_STATE_DISPATCH;
@@ -1764,9 +1764,10 @@ ec_manager_stat(ec_fop_data_t *fop, int32_t state)
case EC_STATE_LOCK:
if (fop->fd == NULL) {
ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
} else {
- ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0, LLONG_MAX);
+ ec_lock_prepare_fd(fop, fop->fd, EC_QUERY_INFO, 0,
+ EC_RANGE_FULL);
}
ec_lock(fop);
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index ffdac632683..b915a992a00 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -68,8 +68,8 @@ out:
return 0;
}
-int32_t
-ec_update_write(ec_fop_data_t *fop, uintptr_t mask, off_t offset, size_t size)
+static int32_t
+ec_update_write(ec_fop_data_t *fop, uintptr_t mask, off_t offset, uint64_t size)
{
struct iobref *iobref = NULL;
struct iobuf *iobuf = NULL;
@@ -219,10 +219,10 @@ ec_manager_xattr(ec_fop_data_t *fop, int32_t state)
if (fop->fd == NULL) {
ec_lock_prepare_inode(fop, &fop->loc[0],
EC_UPDATE_META | EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
} else {
ec_lock_prepare_fd(fop, fop->fd, EC_UPDATE_META | EC_QUERY_INFO,
- 0, LLONG_MAX);
+ 0, EC_RANGE_FULL);
}
ec_lock(fop);
@@ -455,10 +455,10 @@ ec_manager_setattr(ec_fop_data_t *fop, int32_t state)
if (fop->fd == NULL) {
ec_lock_prepare_inode(fop, &fop->loc[0],
EC_UPDATE_META | EC_QUERY_INFO, 0,
- LLONG_MAX);
+ EC_RANGE_FULL);
} else {
ec_lock_prepare_fd(fop, fop->fd, EC_UPDATE_META | EC_QUERY_INFO,
- 0, LLONG_MAX);
+ 0, EC_RANGE_FULL);
}
ec_lock(fop);
@@ -1101,8 +1101,8 @@ ec_update_discard_write(ec_fop_data_t *fop, uintptr_t mask)
ec_t *ec = fop->xl->private;
off_t off_head = 0;
off_t off_tail = 0;
- size_t size_head = 0;
- size_t size_tail = 0;
+ uint64_t size_head = 0;
+ uint64_t size_tail = 0;
int error = 0;
off_head = fop->offset * ec->fragments - fop->int32;
@@ -1172,7 +1172,7 @@ ec_manager_discard(ec_fop_data_t *fop, int32_t state)
{
ec_cbk_data_t *cbk = NULL;
off_t fl_start = 0;
- size_t fl_size = 0;
+ uint64_t fl_size = 0;
switch (state) {
case EC_STATE_INIT:
@@ -1341,7 +1341,7 @@ int32_t
ec_update_truncate_write(ec_fop_data_t *fop, uintptr_t mask)
{
ec_t *ec = fop->xl->private;
- size_t size = fop->offset * ec->fragments - fop->user_size;
+ uint64_t size = fop->offset * ec->fragments - fop->user_size;
return ec_update_write(fop, mask, fop->user_size, size);
}
@@ -1420,12 +1420,12 @@ ec_manager_truncate(ec_fop_data_t *fop, int32_t state)
ec_lock_prepare_inode(
fop, &fop->loc[0],
EC_UPDATE_DATA | EC_UPDATE_META | EC_QUERY_INFO,
- fop->offset, LLONG_MAX);
+ fop->offset, EC_RANGE_FULL);
} else {
ec_lock_prepare_fd(
fop, fop->fd,
EC_UPDATE_DATA | EC_UPDATE_META | EC_QUERY_INFO,
- fop->offset, LLONG_MAX);
+ fop->offset, EC_RANGE_FULL);
}
ec_lock(fop);
@@ -1739,7 +1739,7 @@ ec_writev_merge_tail(call_frame_t *frame, void *cookie, xlator_t *this,
{
ec_t *ec = this->private;
ec_fop_data_t *fop = frame->local;
- size_t size, base, tmp;
+ uint64_t size, base, tmp;
if (op_ret >= 0) {
tmp = 0;
@@ -1772,7 +1772,7 @@ ec_writev_merge_head(call_frame_t *frame, void *cookie, xlator_t *this,
{
ec_t *ec = this->private;
ec_fop_data_t *fop = frame->local;
- size_t size, base;
+ uint64_t size, base;
if (op_ret >= 0) {
size = fop->head;
@@ -1884,7 +1884,7 @@ out:
static void
ec_merge_stripe_head_locked(ec_t *ec, ec_fop_data_t *fop, ec_stripe_t *stripe)
{
- size_t head, size;
+ uint32_t head, size;
head = fop->head;
memcpy(fop->vector[0].iov_base, stripe->data, head);
@@ -1900,7 +1900,7 @@ ec_merge_stripe_head_locked(ec_t *ec, ec_fop_data_t *fop, ec_stripe_t *stripe)
static void
ec_merge_stripe_tail_locked(ec_t *ec, ec_fop_data_t *fop, ec_stripe_t *stripe)
{
- size_t head, tail;
+ uint32_t head, tail;
off_t offset;
offset = fop->user_size + fop->head;
@@ -2117,7 +2117,7 @@ ec_manager_writev(ec_fop_data_t *fop, int32_t state)
ec_fd_t *ctx = NULL;
ec_t *ec = fop->xl->private;
off_t fl_start = 0;
- size_t fl_size = LLONG_MAX;
+ uint64_t fl_size = LONG_MAX;
switch (state) {
case EC_STATE_INIT:
@@ -2163,7 +2163,7 @@ ec_manager_writev(ec_fop_data_t *fop, int32_t state)
cbk = ec_fop_prepare_answer(fop, _gf_false);
if (cbk != NULL) {
ec_t *ec = fop->xl->private;
- size_t size;
+ uint64_t size;
ec_iatt_rebuild(fop->xl->private, cbk->iatt, 2, cbk->count);
diff --git a/xlators/cluster/ec/src/ec-method.c b/xlators/cluster/ec/src/ec-method.c
index 3aff6b096bd..55faed0b193 100644
--- a/xlators/cluster/ec/src/ec-method.c
+++ b/xlators/cluster/ec/src/ec-method.c
@@ -391,10 +391,10 @@ ec_method_update(xlator_t *xl, ec_matrix_list_t *list, const char *gen)
}
void
-ec_method_encode(ec_matrix_list_t *list, size_t size, void *in, void **out)
+ec_method_encode(ec_matrix_list_t *list, uint64_t size, void *in, void **out)
{
ec_matrix_t *matrix;
- size_t pos;
+ uint64_t pos;
uint32_t i;
matrix = list->encode;
@@ -408,11 +408,11 @@ ec_method_encode(ec_matrix_list_t *list, size_t size, void *in, void **out)
}
int32_t
-ec_method_decode(ec_matrix_list_t *list, size_t size, uintptr_t mask,
+ec_method_decode(ec_matrix_list_t *list, uint64_t size, uintptr_t mask,
uint32_t *rows, void **in, void *out)
{
ec_matrix_t *matrix;
- size_t pos;
+ uint64_t pos;
uint32_t i;
matrix = ec_method_matrix_get(list, mask, rows);
diff --git a/xlators/cluster/ec/src/ec-method.h b/xlators/cluster/ec/src/ec-method.h
index 3d6393bed06..ca33f4ffdce 100644
--- a/xlators/cluster/ec/src/ec-method.h
+++ b/xlators/cluster/ec/src/ec-method.h
@@ -41,10 +41,10 @@ int32_t
ec_method_update(xlator_t *xl, ec_matrix_list_t *list, const char *gen);
void
-ec_method_encode(ec_matrix_list_t *list, size_t size, void *in, void **out);
+ec_method_encode(ec_matrix_list_t *list, uint64_t size, void *in, void **out);
int32_t
-ec_method_decode(ec_matrix_list_t *list, size_t size, uintptr_t mask,
+ec_method_decode(ec_matrix_list_t *list, uint64_t size, uintptr_t mask,
uint32_t *rows, void **in, void *out);
#endif /* __EC_METHOD_H__ */
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 0350325d6fb..00c374e7ca3 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -74,7 +74,7 @@ ec_parse_options(xlator_t *this)
gf_msg_debug("ec", 0,
"Initialized with: nodes=%u, fragments=%u, "
- "stripe_size=%u, node_mask=%lX",
+ "stripe_size=%u, node_mask=%" PRIxFAST32,
ec->nodes, ec->fragments, ec->stripe_size, ec->node_mask);
error = 0;
diff --git a/xlators/cluster/stripe/src/stripe-helpers.c b/xlators/cluster/stripe/src/stripe-helpers.c
index 7301494415d..c3743723d1d 100644
--- a/xlators/cluster/stripe/src/stripe-helpers.c
+++ b/xlators/cluster/stripe/src/stripe-helpers.c
@@ -252,7 +252,7 @@ stripe_fill_pathinfo_xattr(xlator_t *this, stripe_local_t *local,
}
len = snprintf(stripe_size_str, sizeof(stripe_size_str), "%" PRId64,
- (long long)(local->fctx) ? local->fctx->stripe_size : 0);
+ local->fctx ? local->fctx->stripe_size : 0);
if (len < 0 || len >= sizeof(stripe_size_str))
goto out;
/* extra bytes for decorations (brackets and <>'s) */
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index a6027d1f281..836bc680897 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -2118,7 +2118,7 @@ stripe_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
stripe_copy_xl_array(local->fctx->xl_array, priv->xl_array,
local->fctx->stripe_count);
- inode_ctx_put(local->inode, this, (uint64_t)local->fctx);
+ inode_ctx_put(local->inode, this, (uint64_t)(uintptr_t)local->fctx);
}
/* Create itself has failed.. so return