diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2018-04-04 10:03:18 +0530 |
---|---|---|
committer | jiffin tony Thottan <jthottan@redhat.com> | 2018-07-05 05:54:11 +0000 |
commit | 1f5393d9a09b2f07e3fa85740b36d14612445f15 (patch) | |
tree | 3d5e0f7781abcaee6dce89af86df1df9fe7f6a65 /xlators/cluster/dht | |
parent | 022466a721981b915ab2c87772061191b8727a3e (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#1563513
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 22 |
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 ca6b5f4ec99..5a72c1fd270 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -1690,13 +1690,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); @@ -1704,6 +1705,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); |