summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht')
-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
7 files changed, 34 insertions, 70 deletions
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);
}