summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-07-13 10:29:48 +0200
committerAnand Avati <avati@redhat.com>2012-07-13 14:03:42 -0700
commit7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 (patch)
tree5a383d85eb18399cf7506a90cc7627c749ccf9b8 /xlators/cluster
parent2dc0d32e5d8b205fa407073b209bb663d546dde8 (diff)
remove useless if-before-free (and free-like) functions
See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-common.c105
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c3
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-algorithm.c3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c3
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c3
-rw-r--r--xlators/cluster/afr/src/pump.c3
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
-rw-r--r--xlators/cluster/dht/src/dht-helper.c23
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c6
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c6
-rw-r--r--xlators/cluster/dht/src/dht.c21
-rw-r--r--xlators/cluster/dht/src/nufa.c15
-rw-r--r--xlators/cluster/dht/src/switch.c30
-rw-r--r--xlators/cluster/ha/src/ha.c8
-rw-r--r--xlators/cluster/map/src/map.c3
-rw-r--r--xlators/cluster/stripe/src/stripe-helpers.c6
-rw-r--r--xlators/cluster/stripe/src/stripe.c15
20 files changed, 88 insertions, 180 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 6787dfc27d5..b6e16074364 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -228,8 +228,7 @@ afr_inode_ctx_get_from_addr (uint64_t addr, int32_t child_count)
ret = 0;
out:
if (ret && ctx) {
- if (ctx->fresh_children)
- GF_FREE (ctx->fresh_children);
+ GF_FREE (ctx->fresh_children);
GF_FREE (ctx);
ctx = NULL;
}
@@ -774,11 +773,9 @@ afr_local_sh_cleanup (afr_local_t *local, xlator_t *this)
sh = &local->self_heal;
priv = this->private;
- if (sh->buf)
- GF_FREE (sh->buf);
+ GF_FREE (sh->buf);
- if (sh->parentbufs)
- GF_FREE (sh->parentbufs);
+ GF_FREE (sh->parentbufs);
if (sh->inode)
inode_unref (sh->inode);
@@ -788,46 +785,36 @@ afr_local_sh_cleanup (afr_local_t *local, xlator_t *this)
GF_FREE (sh->xattr);
}
- if (sh->child_errno)
- GF_FREE (sh->child_errno);
+ GF_FREE (sh->child_errno);
afr_matrix_cleanup (sh->pending_matrix, priv->child_count);
afr_matrix_cleanup (sh->delta_matrix, priv->child_count);
- if (sh->sources)
- GF_FREE (sh->sources);
+ GF_FREE (sh->sources);
- if (sh->success)
- GF_FREE (sh->success);
+ GF_FREE (sh->success);
- if (sh->locked_nodes)
- GF_FREE (sh->locked_nodes);
+ GF_FREE (sh->locked_nodes);
if (sh->healing_fd) {
fd_unref (sh->healing_fd);
sh->healing_fd = NULL;
}
- if (sh->linkname)
- GF_FREE ((char *)sh->linkname);
+ GF_FREE ((char *)sh->linkname);
- if (sh->success_children)
- GF_FREE (sh->success_children);
+ GF_FREE (sh->success_children);
- if (sh->fresh_children)
- GF_FREE (sh->fresh_children);
+ GF_FREE (sh->fresh_children);
- if (sh->fresh_parent_dirs)
- GF_FREE (sh->fresh_parent_dirs);
+ GF_FREE (sh->fresh_parent_dirs);
loc_wipe (&sh->parent_loc);
loc_wipe (&sh->lookup_loc);
- if (sh->checksum)
- GF_FREE (sh->checksum);
+ GF_FREE (sh->checksum);
- if (sh->write_needed)
- GF_FREE (sh->write_needed);
+ GF_FREE (sh->write_needed);
if (sh->healing_fd)
fd_unref (sh->healing_fd);
}
@@ -844,17 +831,13 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
afr_matrix_cleanup (local->transaction.txn_changelog,
priv->child_count);
- if (local->internal_lock.locked_nodes)
- GF_FREE (local->internal_lock.locked_nodes);
+ GF_FREE (local->internal_lock.locked_nodes);
- if (local->internal_lock.inode_locked_nodes)
- GF_FREE (local->internal_lock.inode_locked_nodes);
+ GF_FREE (local->internal_lock.inode_locked_nodes);
- if (local->internal_lock.entry_locked_nodes)
- GF_FREE (local->internal_lock.entry_locked_nodes);
+ GF_FREE (local->internal_lock.entry_locked_nodes);
- if (local->internal_lock.lower_locked_nodes)
- GF_FREE (local->internal_lock.lower_locked_nodes);
+ GF_FREE (local->internal_lock.lower_locked_nodes);
GF_FREE (local->transaction.pre_op);
@@ -894,17 +877,13 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this)
if (local->dict)
dict_unref (local->dict);
- if (local->child_up)
- GF_FREE (local->child_up);
+ GF_FREE (local->child_up);
- if (local->child_errno)
- GF_FREE (local->child_errno);
+ GF_FREE (local->child_errno);
- if (local->fresh_children)
- GF_FREE (local->fresh_children);
+ GF_FREE (local->fresh_children);
- if (local->fd_open_on)
- GF_FREE (local->fd_open_on);
+ GF_FREE (local->fd_open_on);
{ /* lookup */
if (local->cont.lookup.xattrs) {
@@ -922,27 +901,21 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this)
inode_unref (local->cont.lookup.inode);
}
- if (local->cont.lookup.postparents)
- GF_FREE (local->cont.lookup.postparents);
+ GF_FREE (local->cont.lookup.postparents);
- if (local->cont.lookup.bufs)
- GF_FREE (local->cont.lookup.bufs);
+ GF_FREE (local->cont.lookup.bufs);
- if (local->cont.lookup.success_children)
- GF_FREE (local->cont.lookup.success_children);
+ GF_FREE (local->cont.lookup.success_children);
- if (local->cont.lookup.sources)
- GF_FREE (local->cont.lookup.sources);
+ GF_FREE (local->cont.lookup.sources);
}
{ /* getxattr */
- if (local->cont.getxattr.name)
- GF_FREE (local->cont.getxattr.name);
+ GF_FREE (local->cont.getxattr.name);
}
{ /* lk */
- if (local->cont.lk.locked_nodes)
- GF_FREE (local->cont.lk.locked_nodes);
+ GF_FREE (local->cont.lk.locked_nodes);
}
{ /* create */
@@ -997,8 +970,7 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this)
}
{ /* opendir */
- if (local->cont.opendir.checksum)
- GF_FREE (local->cont.opendir.checksum);
+ GF_FREE (local->cont.opendir.checksum);
}
{ /* readdirp */
@@ -2632,28 +2604,22 @@ afr_cleanup_fd_ctx (xlator_t *this, fd_t *fd)
fd_ctx = (afr_fd_ctx_t *)(long) ctx;
if (fd_ctx) {
- if (fd_ctx->pre_op_done)
- GF_FREE (fd_ctx->pre_op_done);
+ GF_FREE (fd_ctx->pre_op_done);
- if (fd_ctx->opened_on)
- GF_FREE (fd_ctx->opened_on);
+ GF_FREE (fd_ctx->opened_on);
- if (fd_ctx->locked_on)
- GF_FREE (fd_ctx->locked_on);
+ GF_FREE (fd_ctx->locked_on);
- if (fd_ctx->pre_op_piggyback)
- GF_FREE (fd_ctx->pre_op_piggyback);
+ GF_FREE (fd_ctx->pre_op_piggyback);
list_for_each_entry_safe (paused_call, tmp, &fd_ctx->paused_calls,
call_list) {
list_del_init (&paused_call->call_list);
GF_FREE (paused_call);
}
- if (fd_ctx->lock_piggyback)
- GF_FREE (fd_ctx->lock_piggyback);
+ GF_FREE (fd_ctx->lock_piggyback);
- if (fd_ctx->lock_acquired)
- GF_FREE (fd_ctx->lock_acquired);
+ GF_FREE (fd_ctx->lock_acquired);
pthread_mutex_destroy (&fd_ctx->delay_lock);
@@ -3615,8 +3581,7 @@ afr_forget (xlator_t *this, inode_t *inode)
goto out;
ctx = (afr_inode_ctx_t *)(long)ctx_addr;
- if (ctx->fresh_children)
- GF_FREE (ctx->fresh_children);
+ GF_FREE (ctx->fresh_children);
GF_FREE (ctx);
out:
return 0;
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 0b804bef580..ca2c3a235f4 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -67,8 +67,7 @@ afr_build_parent_loc (loc_t *parent, loc_t *child, int32_t *op_errno)
ret = 0;
out:
- if (child_path)
- GF_FREE(child_path);
+ GF_FREE(child_path);
return ret;
}
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 02e36b13aba..6ea288a5ee4 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -429,8 +429,7 @@ unlock:
afr_fix_open (frame, this, fd_ctx, need_open_count, need_open);
fop_continue = _gf_false;
out:
- if (need_open)
- GF_FREE (need_open);
+ GF_FREE (need_open);
if (fop_continue && local->fop_call_continue)
local->fop_call_continue (frame, this);
return ret;
diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
index 18edca8c1eb..201e12c523f 100644
--- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c
+++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
@@ -63,8 +63,7 @@ sh_private_cleanup (call_frame_t *frame, xlator_t *this)
sh = &local->self_heal;
sh_priv = sh->private;
- if (sh_priv)
- GF_FREE (sh_priv);
+ GF_FREE (sh_priv);
}
static int
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index c4384ebc572..b5b4627f684 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -474,8 +474,7 @@ afr_mark_biggest_of_fools_as_source (int32_t *sources, int32_t **pending_matrix,
characters, child_count,
biggest_witness);
out:
- if (witnesses)
- GF_FREE (witnesses);
+ GF_FREE (witnesses);
return nsources;
}
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 7186da710b3..2edee5fd460 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -988,8 +988,7 @@ afr_sh_data_fstat (call_frame_t *frame, xlator_t *this)
}
GF_ASSERT (!call_count);
out:
- if (fstat_children)
- GF_FREE (fstat_children);
+ GF_FREE (fstat_children);
return 0;
}
@@ -1130,8 +1129,7 @@ out:
dict_unref (xattr_req);
if (ret) {
- if (zero_pending)
- GF_FREE (zero_pending);
+ GF_FREE (zero_pending);
afr_sh_data_fail (frame, this);
}
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index c5deb18b8af..6184036b278 100644
--- a/xlators/cluster/afr/src/afr-self-heald.c
+++ b/xlators/cluster/afr/src/afr-self-heald.c
@@ -85,8 +85,7 @@ shd_cleanup_event (void *event)
if (!shd_event)
goto out;
- if (shd_event->path)
- GF_FREE (shd_event->path);
+ GF_FREE (shd_event->path);
GF_FREE (shd_event);
out:
return;
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index c4378d4451f..2144f483fd0 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -414,8 +414,7 @@ afr_transaction_rm_stale_children (call_frame_t *frame, xlator_t *this,
afr_inode_rm_stale_children (this, inode, stale_children);
out:
- if (stale_children)
- GF_FREE (stale_children);
+ GF_FREE (stale_children);
return;
}
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c
index eb3f8478928..ff42d8dc11c 100644
--- a/xlators/cluster/afr/src/pump.c
+++ b/xlators/cluster/afr/src/pump.c
@@ -996,8 +996,7 @@ out:
if (dict)
dict_unref (dict);
- if (dict_str)
- GF_FREE (dict_str);
+ GF_FREE (dict_str);
return 0;
}
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index eaafc2bfb3e..51e2c37ae37 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1784,8 +1784,7 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
ret = dict_set_dynstr (dict, local->xsel, xattr_buf);
- if (local->xattr_val)
- GF_FREE (local->xattr_val);
+ GF_FREE (local->xattr_val);
DHT_STACK_UNWIND (getxattr, frame, op_ret, op_errno, dict,
xdata);
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 611de19e48e..f0e74a15423 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -120,10 +120,8 @@ dht_filter_loc_subvol_key (xlator_t *this, loc_t *loc, loc_t *new_loc,
out:
if (!ret) {
/* !success */
- if (new_path)
- GF_FREE (new_path);
- if (new_name)
- GF_FREE (new_name);
+ GF_FREE (new_path);
+ GF_FREE (new_name);
}
return ret;
}
@@ -206,16 +204,11 @@ dht_local_wipe (xlator_t *this, dht_local_t *local)
local->selfheal.layout = NULL;
}
- if (local->newpath) {
- GF_FREE (local->newpath);
- }
+ GF_FREE (local->newpath);
- if (local->key) {
- GF_FREE (local->key);
- }
+ GF_FREE (local->key);
- if (local->rebalance.vector)
- GF_FREE (local->rebalance.vector);
+ GF_FREE (local->rebalance.vector);
if (local->rebalance.iobref)
iobref_unref (local->rebalance.iobref);
@@ -750,8 +743,7 @@ dht_migration_complete_check_task (void *data)
tmp_loc.path = path;
ret = syncop_open (dst_node, &tmp_loc,
local->fd->flags, local->fd);
- if (path)
- GF_FREE (path);
+ GF_FREE (path);
}
if (ret == -1) {
@@ -874,8 +866,7 @@ dht_rebalance_inprogress_task (void *data)
tmp_loc.path = path;
ret = syncop_open (dst_node, &tmp_loc,
local->fd->flags, local->fd);
- if (path)
- GF_FREE (path);
+ GF_FREE (path);
}
if (ret == -1) {
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index d2a59cc4312..e33875ffcfc 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -408,8 +408,7 @@ __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst
offset += ret;
total += ret;
- if (vector)
- GF_FREE (vector);
+ GF_FREE (vector);
if (iobref)
iobref_unref (iobref);
iobref = NULL;
@@ -417,8 +416,7 @@ __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst
}
if (iobref)
iobref_unref (iobref);
- if (vector)
- GF_FREE (vector);
+ GF_FREE (vector);
if (ret >= 0)
ret = 0;
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 7ceb80157d5..8b7d15ce520 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -182,8 +182,7 @@ err:
if (xattr)
dict_destroy (xattr);
- if (disk_layout)
- GF_FREE (disk_layout);
+ GF_FREE (disk_layout);
dht_selfheal_dir_xattr_cbk (frame, subvol, frame->this,
-1, ENOMEM, NULL);
@@ -703,8 +702,7 @@ done:
local->layout = new_layout;
}
- if (fix_array)
- GF_FREE (fix_array);
+ GF_FREE (fix_array);
return local->layout;
}
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index c5128544279..6b156c1d354 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -213,11 +213,9 @@ fini (xlator_t *this)
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
GF_FREE (conf);
}
@@ -280,8 +278,7 @@ dht_parse_decommissioned_bricks (xlator_t *this, dht_conf_t *conf,
ret = 0;
conf->decommission_in_progress = 1;
out:
- if (dup_brick)
- GF_FREE (dup_brick);
+ GF_FREE (dup_brick);
return ret;
}
@@ -483,17 +480,13 @@ err:
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
- if (conf->du_stats)
- GF_FREE (conf->du_stats);
+ GF_FREE (conf->du_stats);
- if (conf->defrag)
- GF_FREE (conf->defrag);
+ GF_FREE (conf->defrag);
GF_FREE (conf);
}
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index 2179870d9ad..53c66aa45aa 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -481,11 +481,9 @@ fini (xlator_t *this)
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
GF_FREE (conf);
}
@@ -629,14 +627,11 @@ err:
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
- if (conf->du_stats)
- GF_FREE (conf->du_stats);
+ GF_FREE (conf->du_stats);
GF_FREE (conf);
}
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index ab261da870f..0542d7f9afc 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -95,8 +95,7 @@ get_switch_matching_subvol (const char *path, dht_conf_t *conf,
trav = trav->next;
}
out:
- if (pathname)
- GF_FREE (pathname);
+ GF_FREE (pathname);
return subvol;
}
@@ -589,8 +588,7 @@ fini (xlator_t *this)
trav = (struct switch_struct *)conf->private;
conf->private = NULL;
while (trav) {
- if (trav->array)
- GF_FREE (trav->array);
+ GF_FREE (trav->array);
prev = trav;
trav = trav->next;
GF_FREE (prev);
@@ -603,11 +601,9 @@ fini (xlator_t *this)
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
GF_FREE (conf);
}
@@ -822,16 +818,13 @@ set_switch_pattern (xlator_t *this, dht_conf_t *conf,
return 0;
err:
- if (switch_buf_array)
- GF_FREE (switch_buf_array);
- if (switch_opt)
- GF_FREE (switch_opt);
+ GF_FREE (switch_buf_array);
+ GF_FREE (switch_opt);
if (switch_buf) {
trav = switch_buf;
while (trav) {
- if (trav->array)
- GF_FREE (trav->array);
+ GF_FREE (trav->array);
switch_opt = trav;
trav = trav->next;
GF_FREE (switch_opt);
@@ -954,14 +947,11 @@ err:
GF_FREE (conf->file_layouts);
}
- if (conf->subvolumes)
- GF_FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
- if (conf->subvolume_status)
- GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
- if (conf->du_stats)
- GF_FREE (conf->du_stats);
+ GF_FREE (conf->du_stats);
GF_FREE (conf);
}
diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c
index 38d4229d3cb..e7956b82669 100644
--- a/xlators/cluster/ha/src/ha.c
+++ b/xlators/cluster/ha/src/ha.c
@@ -1876,13 +1876,9 @@ err:
}
if (hafdp) {
- if (hafdp->fdstate) {
- GF_FREE (hafdp->fdstate);
- }
+ GF_FREE (hafdp->fdstate);
- if (hafdp->path) {
- GF_FREE (hafdp->path);
- }
+ GF_FREE (hafdp->path);
GF_FREE (hafdp);
}
diff --git a/xlators/cluster/map/src/map.c b/xlators/cluster/map/src/map.c
index ead9da0b92c..06d629a7e9b 100644
--- a/xlators/cluster/map/src/map.c
+++ b/xlators/cluster/map/src/map.c
@@ -2375,8 +2375,7 @@ fini (xlator_t *this)
priv = this->private;
if (priv) {
- if (priv->xlarray)
- GF_FREE (priv->xlarray);
+ GF_FREE (priv->xlarray);
trav_map = priv->map;
while (trav_map) {
diff --git a/xlators/cluster/stripe/src/stripe-helpers.c b/xlators/cluster/stripe/src/stripe-helpers.c
index 336da793e55..8053f871a0d 100644
--- a/xlators/cluster/stripe/src/stripe-helpers.c
+++ b/xlators/cluster/stripe/src/stripe-helpers.c
@@ -508,11 +508,9 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data)
ret = 0;
out:
- if (dup_str)
- GF_FREE (dup_str);
+ GF_FREE (dup_str);
- if (stripe_opt)
- GF_FREE (stripe_opt);
+ GF_FREE (stripe_opt);
return ret;
}
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index efee9444e9e..6aae3da4452 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3265,8 +3265,7 @@ stripe_readv_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
count, &tmp_stbuf, tmp_iobref, NULL);
iobref_unref (tmp_iobref);
- if (vec)
- GF_FREE (vec);
+ GF_FREE (vec);
}
out:
return 0;
@@ -3399,8 +3398,7 @@ stripe_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
final_count, &tmp_stbuf, tmp_iobref, NULL);
iobref_unref (tmp_iobref);
- if (final_vec)
- GF_FREE (final_vec);
+ GF_FREE (final_vec);
}
goto out;
@@ -4489,8 +4487,7 @@ init (xlator_t *this)
out:
if (ret) {
if (priv) {
- if (priv->xl_array)
- GF_FREE (priv->xl_array);
+ GF_FREE (priv->xl_array);
GF_FREE (priv);
}
}
@@ -4514,8 +4511,7 @@ fini (xlator_t *this)
priv = this->private;
if (priv) {
this->private = NULL;
- if (priv->xl_array)
- GF_FREE (priv->xl_array);
+ GF_FREE (priv->xl_array);
trav = priv->pattern;
while (trav) {
@@ -4699,8 +4695,7 @@ stripe_vgetxattr_cbk (call_frame_t *frame, void *cookie,
ret = stripe_free_xattr_str (local);
- if (local->xattr_list)
- GF_FREE (local->xattr_list);
+ GF_FREE (local->xattr_list);
if (stripe_xattr)
dict_unref (stripe_xattr);