|
|
9ae3f9 |
From 9c5f5b4ffd49e8c8631defb7b6873248bbfdaf9c Mon Sep 17 00:00:00 2001
|
|
|
9ae3f9 |
From: Rinku Kothiya <rkothiya@redhat.com>
|
|
|
9ae3f9 |
Date: Tue, 23 Jul 2019 13:16:04 +0000
|
|
|
9ae3f9 |
Subject: [PATCH 405/449] [core] fix return of local in __nlc_inode_ctx_get
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
__nlc_inode_ctx_get assigns a value to nlc_pe_p which is never used by
|
|
|
9ae3f9 |
its parent function or any of the predecessor hence remove the
|
|
|
9ae3f9 |
assignment and also that function argument as it is not being used
|
|
|
9ae3f9 |
anywhere.
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
> fixes: bz#1732496
|
|
|
9ae3f9 |
> Change-Id: I5b950e1e251bd50a646616da872a4efe9d2ff8c9
|
|
|
9ae3f9 |
> (Cherry pick from commit 84a55090123a7e3124100e5564da8c521c3c22ab )
|
|
|
9ae3f9 |
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23093/)
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
BUG: 1686897
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
Change-Id: I5b950e1e251bd50a646616da872a4efe9d2ff8c9
|
|
|
9ae3f9 |
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
|
|
|
9ae3f9 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/202372
|
|
|
9ae3f9 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
9ae3f9 |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
9ae3f9 |
---
|
|
|
9ae3f9 |
xlators/performance/nl-cache/src/nl-cache-helper.c | 36 +++++++++-------------
|
|
|
9ae3f9 |
1 file changed, 14 insertions(+), 22 deletions(-)
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
diff --git a/xlators/performance/nl-cache/src/nl-cache-helper.c b/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
9ae3f9 |
index 009f33a..4314038 100644
|
|
|
9ae3f9 |
--- a/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
9ae3f9 |
+++ b/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
9ae3f9 |
@@ -145,12 +145,10 @@ nlc_disable_cache(xlator_t *this)
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
static int
|
|
|
9ae3f9 |
-__nlc_inode_ctx_get(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p,
|
|
|
9ae3f9 |
- nlc_pe_t **nlc_pe_p)
|
|
|
9ae3f9 |
+__nlc_inode_ctx_get(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p)
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
int ret = 0;
|
|
|
9ae3f9 |
nlc_ctx_t *nlc_ctx = NULL;
|
|
|
9ae3f9 |
- nlc_pe_t *nlc_pe = NULL;
|
|
|
9ae3f9 |
uint64_t nlc_ctx_int = 0;
|
|
|
9ae3f9 |
uint64_t nlc_pe_int = 0;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -159,10 +157,6 @@ __nlc_inode_ctx_get(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p,
|
|
|
9ae3f9 |
nlc_ctx = (void *)(long)(nlc_ctx_int);
|
|
|
9ae3f9 |
*nlc_ctx_p = nlc_ctx;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
- if (ret == 0 && nlc_pe_p) {
|
|
|
9ae3f9 |
- nlc_pe = (void *)(long)(nlc_pe_int);
|
|
|
9ae3f9 |
- *nlc_pe_p = nlc_pe;
|
|
|
9ae3f9 |
- }
|
|
|
9ae3f9 |
return ret;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -186,14 +180,13 @@ nlc_inode_ctx_set(xlator_t *this, inode_t *inode, nlc_ctx_t *nlc_ctx,
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
static void
|
|
|
9ae3f9 |
-nlc_inode_ctx_get(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p,
|
|
|
9ae3f9 |
- nlc_pe_t **nlc_pe_p)
|
|
|
9ae3f9 |
+nlc_inode_ctx_get(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p)
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
int ret = 0;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
LOCK(&inode->lock);
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
- ret = __nlc_inode_ctx_get(this, inode, nlc_ctx_p, nlc_pe_p);
|
|
|
9ae3f9 |
+ ret = __nlc_inode_ctx_get(this, inode, nlc_ctx_p);
|
|
|
9ae3f9 |
if (ret < 0)
|
|
|
9ae3f9 |
gf_msg_debug(this->name, 0,
|
|
|
9ae3f9 |
"inode ctx get failed for "
|
|
|
9ae3f9 |
@@ -290,8 +283,7 @@ out:
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
static nlc_ctx_t *
|
|
|
9ae3f9 |
-nlc_inode_ctx_get_set(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p,
|
|
|
9ae3f9 |
- nlc_pe_t **nlc_pe_p)
|
|
|
9ae3f9 |
+nlc_inode_ctx_get_set(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p)
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
int ret = 0;
|
|
|
9ae3f9 |
nlc_ctx_t *nlc_ctx = NULL;
|
|
|
9ae3f9 |
@@ -301,7 +293,7 @@ nlc_inode_ctx_get_set(xlator_t *this, inode_t *inode, nlc_ctx_t **nlc_ctx_p,
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
LOCK(&inode->lock);
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
- ret = __nlc_inode_ctx_get(this, inode, &nlc_ctx, nlc_pe_p);
|
|
|
9ae3f9 |
+ ret = __nlc_inode_ctx_get(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (nlc_ctx)
|
|
|
9ae3f9 |
goto unlock;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -410,7 +402,7 @@ nlc_set_dir_state(xlator_t *this, inode_t *inode, uint64_t state)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get_set(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get_set(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -430,7 +422,7 @@ nlc_cache_timeout_handler(struct gf_tw_timer_list *timer, void *data,
|
|
|
9ae3f9 |
nlc_timer_data_t *tmp = data;
|
|
|
9ae3f9 |
nlc_ctx_t *nlc_ctx = NULL;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(tmp->this, tmp->inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(tmp->this, tmp->inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -696,7 +688,7 @@ nlc_inode_clear_cache(xlator_t *this, inode_t *inode, int reason)
|
|
|
9ae3f9 |
{
|
|
|
9ae3f9 |
nlc_ctx_t *nlc_ctx = NULL;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -883,7 +875,7 @@ nlc_dir_add_ne(xlator_t *this, inode_t *inode, const char *name)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get_set(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get_set(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -914,7 +906,7 @@ nlc_dir_remove_pe(xlator_t *this, inode_t *parent, inode_t *entry_ino,
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(this, parent, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(this, parent, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -945,7 +937,7 @@ nlc_dir_add_pe(xlator_t *this, inode_t *inode, inode_t *entry_ino,
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get_set(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get_set(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -1051,7 +1043,7 @@ nlc_is_negative_lookup(xlator_t *this, loc_t *loc)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -1102,7 +1094,7 @@ nlc_get_real_file_name(xlator_t *this, loc_t *loc, const char *fname,
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
}
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
@@ -1152,7 +1144,7 @@ nlc_dump_inodectx(xlator_t *this, inode_t *inode)
|
|
|
9ae3f9 |
nlc_ne_t *ne = NULL;
|
|
|
9ae3f9 |
nlc_ne_t *tmp1 = NULL;
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
- nlc_inode_ctx_get(this, inode, &nlc_ctx, NULL);
|
|
|
9ae3f9 |
+ nlc_inode_ctx_get(this, inode, &nlc_ctx);
|
|
|
9ae3f9 |
|
|
|
9ae3f9 |
if (!nlc_ctx)
|
|
|
9ae3f9 |
goto out;
|
|
|
9ae3f9 |
--
|
|
|
9ae3f9 |
1.8.3.1
|
|
|
9ae3f9 |
|