summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRinku Kothiya <rkothiya@redhat.com>2021-03-22 10:18:15 +0530
committerGitHub <noreply@github.com>2021-03-22 10:18:15 +0530
commit1da141ab38463c4a26474456eec81c5992367af9 (patch)
tree08d49c3f7e61cc64ba8064f2e6c96e36f9b83a10 /xlators
parentbb0130d3df0a1f32e23eabca0bf559f4de1bbb55 (diff)
downloadglusterfs-1da141ab38463c4a26474456eec81c5992367af9.tar.gz
glusterfs-1da141ab38463c4a26474456eec81c5992367af9.tar.xz
glusterfs-1da141ab38463c4a26474456eec81c5992367af9.zip
Cleanup unused this pointers (#2282)
fixes: #2268 Change-Id: If00ee847e15ac7f7e5b0e12125a7d02a610b9708 Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-common.c28
-rw-r--r--xlators/cluster/dht/src/dht-common.h12
-rw-r--r--xlators/cluster/dht/src/dht-diskusage.c2
-rw-r--r--xlators/cluster/dht/src/dht-helper.c14
-rw-r--r--xlators/cluster/dht/src/dht-layout.c6
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c12
-rw-r--r--xlators/cluster/dht/src/nufa.c2
-rw-r--r--xlators/cluster/dht/src/switch.c2
8 files changed, 35 insertions, 43 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 055520a917..fcaf1fc336 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1920,7 +1920,7 @@ unlock:
if (local->layout_mismatch) {
/* Found layout mismatch in the directory, need to
fix this in the inode context */
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = NULL;
dht_lookup_directory(frame, this, &local->loc);
return 0;
@@ -1929,7 +1929,7 @@ unlock:
if (local->need_lookup_everywhere) {
/* As the current layout gave ENOENT error, we would
need a new layout */
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = NULL;
/* We know that current cached subvol is no longer
@@ -3401,7 +3401,7 @@ dht_do_revalidate(call_frame_t *frame, xlator_t *this, loc_t *loc)
/* Generation number has changed. This layout may be stale. */
if (layout->gen && (layout->gen < conf->gen)) {
gen = layout->gen;
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = NULL;
local->cached_subvol = NULL;
@@ -6622,7 +6622,7 @@ dht_populate_inode_for_dentry(xlator_t *this, xlator_t *subvol,
}
if (layout)
- dht_layout_unref(this, layout);
+ dht_layout_unref(layout);
out:
loc_wipe(&loc);
@@ -6649,10 +6649,8 @@ dht_queue_readdir(call_frame_t *frame, xlator_t *xl, off_t offset,
{
dht_local_t *local;
int32_t queue;
- xlator_t *this = NULL;
local = frame->local;
- this = frame->this;
local->queue_xl = xl;
local->queue_offset = offset;
@@ -6679,7 +6677,7 @@ dht_queue_readdir(call_frame_t *frame, xlator_t *xl, off_t offset,
/* A negative value means that an unwind has been called before
* returning from the previous wind. This means that 'local' is
* not needed anymore and must be destroyed. */
- dht_local_wipe(this, local);
+ dht_local_wipe(local);
}
}
}
@@ -6692,10 +6690,8 @@ dht_queue_readdirp(call_frame_t *frame, xlator_t *xl, off_t offset,
{
dht_local_t *local;
int32_t queue;
- xlator_t *this = NULL;
local = frame->local;
- this = frame->this;
local->queue_xl = xl;
local->queue_offset = offset;
@@ -6712,7 +6708,7 @@ dht_queue_readdirp(call_frame_t *frame, xlator_t *xl, off_t offset,
/* A negative value means that an unwind has been called before
* returning from the previous wind. This means that 'local' is
* not needed anymore and must be destroyed. */
- dht_local_wipe(this, local);
+ dht_local_wipe(local);
}
}
}
@@ -7878,7 +7874,7 @@ dht_guard_parent_layout_and_namespace(xlator_t *subvol, call_stub_t *stub)
memcpy((void *)local->parent_disk_layout, (void *)parent_disk_layout,
sizeof(local->parent_disk_layout));
- dht_layout_unref(this, parent_layout);
+ dht_layout_unref(parent_layout);
parent_layout = NULL;
ret = dict_set_str(local->params, GF_PREOP_PARENT_KEY, conf->xattr_name);
@@ -7921,7 +7917,7 @@ err:
GF_FREE(parent_disk_layout);
if (parent_layout != NULL)
- dht_layout_unref(this, parent_layout);
+ dht_layout_unref(parent_layout);
return -1;
}
@@ -8993,7 +8989,7 @@ dht_set_parent_layout_in_dict(loc_t *loc, xlator_t *this, dht_local_t *local)
}
err:
- dht_layout_unref(this, parent_layout);
+ dht_layout_unref(parent_layout);
return ret;
}
@@ -9330,7 +9326,7 @@ dht_mkdir_helper(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
memcpy((void *)local->parent_disk_layout, (void *)parent_disk_layout,
sizeof(local->parent_disk_layout));
- dht_layout_unref(this, parent_layout);
+ dht_layout_unref(parent_layout);
parent_layout = NULL;
ret = dict_set_str(params, GF_PREOP_PARENT_KEY, conf->xattr_name);
@@ -9372,7 +9368,7 @@ err:
GF_FREE(parent_disk_layout);
if (parent_layout != NULL)
- dht_layout_unref(this, parent_layout);
+ dht_layout_unref(parent_layout);
return 0;
}
@@ -10925,7 +10921,7 @@ dht_forget(xlator_t *this, inode_t *inode)
layout = ctx->layout;
ctx->layout = NULL;
- dht_layout_unref(this, layout);
+ dht_layout_unref(layout);
GF_FREE(ctx);
return 0;
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 2bf595175e..fd43d9ec47 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -711,25 +711,21 @@ typedef struct dht_fd_ctx {
#define DHT_STACK_UNWIND(fop, frame, params...) \
do { \
dht_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
if (frame) { \
- __xl = frame->this; \
__local = frame->local; \
frame->local = NULL; \
} \
STACK_UNWIND_STRICT(fop, frame, params); \
- dht_local_wipe(__xl, __local); \
+ dht_local_wipe(__local); \
} while (0)
#define DHT_STACK_DESTROY(frame) \
do { \
dht_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
__local = frame->local; \
frame->local = NULL; \
STACK_DESTROY(frame->root); \
- dht_local_wipe(__xl, __local); \
+ dht_local_wipe(__local); \
} while (0)
#define DHT_UPDATE_TIME(ctx_sec, ctx_nsec, new_sec, new_nsec, post) \
@@ -812,7 +808,7 @@ int
dht_deitransform(xlator_t *this, uint64_t y, xlator_t **subvol);
void
-dht_local_wipe(xlator_t *this, dht_local_t *local);
+dht_local_wipe(dht_local_t *local);
dht_local_t *
dht_local_init(call_frame_t *frame, loc_t *loc, fd_t *fd, glusterfs_fop_t fop);
int
@@ -867,7 +863,7 @@ int
dht_layout_set(xlator_t *this, inode_t *inode, dht_layout_t *layout);
;
void
-dht_layout_unref(xlator_t *this, dht_layout_t *layout);
+dht_layout_unref(dht_layout_t *layout);
dht_layout_t *
dht_layout_ref(xlator_t *this, dht_layout_t *layout);
int
diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c
index c0588828fd..ab6b21b175 100644
--- a/xlators/cluster/dht/src/dht-diskusage.c
+++ b/xlators/cluster/dht/src/dht-diskusage.c
@@ -329,7 +329,7 @@ out:
}
if (layout)
- dht_layout_unref(this, layout);
+ dht_layout_unref(layout);
return avail_subvol;
}
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 3f2fe43d5f..6223da5bd0 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -710,7 +710,7 @@ dht_deitransform(xlator_t *this, uint64_t y, xlator_t **subvol_p)
}
void
-dht_local_wipe(xlator_t *this, dht_local_t *local)
+dht_local_wipe(dht_local_t *local)
{
int i = 0;
@@ -728,7 +728,7 @@ dht_local_wipe(xlator_t *this, dht_local_t *local)
inode_unref(local->inode);
if (local->layout) {
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = NULL;
}
@@ -758,12 +758,12 @@ dht_local_wipe(xlator_t *this, dht_local_t *local)
dict_unref(local->xdata);
if (local->selfheal.layout) {
- dht_layout_unref(this, local->selfheal.layout);
+ dht_layout_unref(local->selfheal.layout);
local->selfheal.layout = NULL;
}
if (local->selfheal.refreshed_layout) {
- dht_layout_unref(this, local->selfheal.refreshed_layout);
+ dht_layout_unref(local->selfheal.refreshed_layout);
local->selfheal.refreshed_layout = NULL;
}
@@ -950,7 +950,7 @@ dht_subvol_get_hashed(xlator_t *this, loc_t *loc)
out:
if (layout) {
- dht_layout_unref(this, layout);
+ dht_layout_unref(layout);
}
return subvol;
@@ -975,7 +975,7 @@ dht_subvol_get_cached(xlator_t *this, inode_t *inode)
out:
if (layout) {
- dht_layout_unref(this, layout);
+ dht_layout_unref(layout);
}
return subvol;
@@ -1380,7 +1380,7 @@ dht_migration_complete_check_task(void *data)
/* update local. A layout is set in inode-ctx in lookup already */
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = dht_layout_get(frame->this, inode);
local->cached_subvol = dst_node;
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index fda904c92c..2dbd9f3960 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -87,7 +87,7 @@ dht_layout_set(xlator_t *this, inode_t *inode, dht_layout_t *layout)
UNLOCK(&conf->layout_lock);
if (!oldret) {
- dht_layout_unref(this, old_layout);
+ dht_layout_unref(old_layout);
}
if (ret)
GF_ATOMIC_DEC(layout->ref);
@@ -97,11 +97,11 @@ out:
}
void
-dht_layout_unref(xlator_t *this, dht_layout_t *layout)
+dht_layout_unref(dht_layout_t *layout)
{
int ref = 0;
- if (!layout || layout->preset || !this->private)
+ if (!layout || layout->preset)
return;
ref = GF_ATOMIC_DEC(layout->ref);
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 3e24065227..5684a7af1b 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -156,7 +156,7 @@ dht_refresh_layout_done(call_frame_t *frame)
local->selfheal.refreshed_layout = NULL;
local->selfheal.layout = refreshed;
- dht_layout_unref(frame->this, heal);
+ dht_layout_unref(heal);
dht_selfheal_dir_finish(frame, frame->this, 0, 1);
}
@@ -256,7 +256,7 @@ dht_refresh_layout(call_frame_t *frame)
local->op_ret = -1;
if (local->selfheal.refreshed_layout) {
- dht_layout_unref(this, local->selfheal.refreshed_layout);
+ dht_layout_unref(local->selfheal.refreshed_layout);
local->selfheal.refreshed_layout = NULL;
}
@@ -545,7 +545,7 @@ dht_selfheal_layout_lock(call_frame_t *frame, dht_layout_t *layout,
tmp = local->selfheal.layout;
local->selfheal.layout = dht_layout_ref(frame->this, layout);
- dht_layout_unref(frame->this, tmp);
+ dht_layout_unref(tmp);
if (!newdir) {
count = conf->subvolume_cnt;
@@ -856,7 +856,7 @@ dht_fix_dir_xattr(call_frame_t *frame, loc_t *loc, dht_layout_t *layout)
}
}
- dht_layout_unref(this, dummy);
+ dht_layout_unref(dummy);
out:
return 0;
}
@@ -933,7 +933,7 @@ dht_selfheal_dir_xattr(call_frame_t *frame, loc_t *loc, dht_layout_t *layout)
}
}
- dht_layout_unref(this, dummy);
+ dht_layout_unref(dummy);
out:
return 0;
}
@@ -1708,7 +1708,7 @@ dht_fix_layout_of_directory(call_frame_t *frame, loc_t *loc,
done:
if (new_layout) {
/* Make sure the extra 'ref' for existing layout is removed */
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
local->layout = new_layout;
}
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index 3648a56484..f76771c16f 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -180,7 +180,7 @@ nufa_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
if (layout->gen && (layout->gen < conf->gen)) {
gf_msg_debug(this->name, 0, "incomplete layout failure for path=%s",
loc->path);
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
goto do_fresh_lookup;
}
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index 207d109a02..97828ac799 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -264,7 +264,7 @@ switch_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc,
if (layout->gen && (layout->gen < conf->gen)) {
gf_msg_debug(this->name, 0, "incomplete layout failure for path=%s",
loc->path);
- dht_layout_unref(this, local->layout);
+ dht_layout_unref(local->layout);
goto do_fresh_lookup;
}