summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2018-04-04 10:03:18 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-04-10 02:23:51 +0000
commit13c8bf60155b5ab09d60d4a04f2b0d38014e5fca (patch)
tree12942fbe1127933095adc5e3da911de5e039043a /xlators/cluster/dht/src
parent48623a33a0ef38f6c99208b0580954d7d7c80e76 (diff)
cluster/dht: act as passthrough for renames on single child DHT
Various synchronization present in dht_rename while handling directories and files is necessary only if we have more than only one child. Change-Id: Ie21ad419125504ca2f391b1ae2e5c1d166fee247 fixes: bz#1563511 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 2e39fe6c7ab..e61d67ca6d8 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -1663,13 +1663,14 @@ int
dht_rename (call_frame_t *frame, xlator_t *this,
loc_t *oldloc, loc_t *newloc, dict_t *xdata)
{
- xlator_t *src_cached = NULL;
- xlator_t *src_hashed = NULL;
- xlator_t *dst_cached = NULL;
- xlator_t *dst_hashed = NULL;
- int op_errno = -1;
- int ret = -1;
- dht_local_t *local = NULL;
+ xlator_t *src_cached = NULL;
+ xlator_t *src_hashed = NULL;
+ xlator_t *dst_cached = NULL;
+ xlator_t *dst_hashed = NULL;
+ int op_errno = -1;
+ int ret = -1;
+ dht_local_t *local = NULL;
+ dht_conf_t *conf = NULL;
char gfid[GF_UUID_BUF_SIZE] = {0};
VALIDATE_OR_GOTO (frame, err);
@@ -1677,6 +1678,13 @@ dht_rename (call_frame_t *frame, xlator_t *this,
VALIDATE_OR_GOTO (oldloc, err);
VALIDATE_OR_GOTO (newloc, err);
+ conf = this->private;
+
+ if (conf->subvolume_cnt == 1) {
+ default_rename (frame, this, oldloc, newloc, xdata);
+ return 0;
+ }
+
gf_uuid_unparse(oldloc->inode->gfid, gfid);
src_hashed = dht_subvol_get_hashed (this, oldloc);