From 13c8bf60155b5ab09d60d4a04f2b0d38014e5fca Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 4 Apr 2018 10:03:18 +0530 Subject: 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 --- xlators/cluster/dht/src/dht-rename.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'xlators') 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); -- cgit