|
|
e7a346 |
From 4eef56dc01a9ab11d56f30dd29e2eb65c82cc01d Mon Sep 17 00:00:00 2001
|
|
|
e7a346 |
From: Raghavendra G <rgowdapp@redhat.com>
|
|
|
e7a346 |
Date: Wed, 4 Apr 2018 10:03:18 +0530
|
|
|
e7a346 |
Subject: [PATCH 250/260] cluster/dht: act as passthrough for renames on single
|
|
|
e7a346 |
child DHT
|
|
|
e7a346 |
|
|
|
e7a346 |
Various synchronization present in dht_rename while handling
|
|
|
e7a346 |
directories and files is necessary only if we have more than only one
|
|
|
e7a346 |
child.
|
|
|
e7a346 |
|
|
|
e7a346 |
> Change-Id: Ie21ad419125504ca2f391b1ae2e5c1d166fee247
|
|
|
e7a346 |
> fixes: bz#1563511
|
|
|
e7a346 |
> Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
e7a346 |
|
|
|
e7a346 |
upstream patch: https://review.gluster.org/19817/
|
|
|
e7a346 |
Change-Id: Ie21ad419125504ca2f391b1ae2e5c1d166fee247
|
|
|
e7a346 |
BUG: 1572087
|
|
|
e7a346 |
fixes: bz#1572087
|
|
|
e7a346 |
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
e7a346 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/137257
|
|
|
e7a346 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
e7a346 |
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
|
|
|
e7a346 |
---
|
|
|
e7a346 |
xlators/cluster/dht/src/dht-rename.c | 22 +++++++++++++++-------
|
|
|
e7a346 |
1 file changed, 15 insertions(+), 7 deletions(-)
|
|
|
e7a346 |
|
|
|
e7a346 |
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
|
|
|
e7a346 |
index ca6b5f4..5a72c1f 100644
|
|
|
e7a346 |
--- a/xlators/cluster/dht/src/dht-rename.c
|
|
|
e7a346 |
+++ b/xlators/cluster/dht/src/dht-rename.c
|
|
|
e7a346 |
@@ -1690,13 +1690,14 @@ int
|
|
|
e7a346 |
dht_rename (call_frame_t *frame, xlator_t *this,
|
|
|
e7a346 |
loc_t *oldloc, loc_t *newloc, dict_t *xdata)
|
|
|
e7a346 |
{
|
|
|
e7a346 |
- xlator_t *src_cached = NULL;
|
|
|
e7a346 |
- xlator_t *src_hashed = NULL;
|
|
|
e7a346 |
- xlator_t *dst_cached = NULL;
|
|
|
e7a346 |
- xlator_t *dst_hashed = NULL;
|
|
|
e7a346 |
- int op_errno = -1;
|
|
|
e7a346 |
- int ret = -1;
|
|
|
e7a346 |
- dht_local_t *local = NULL;
|
|
|
e7a346 |
+ xlator_t *src_cached = NULL;
|
|
|
e7a346 |
+ xlator_t *src_hashed = NULL;
|
|
|
e7a346 |
+ xlator_t *dst_cached = NULL;
|
|
|
e7a346 |
+ xlator_t *dst_hashed = NULL;
|
|
|
e7a346 |
+ int op_errno = -1;
|
|
|
e7a346 |
+ int ret = -1;
|
|
|
e7a346 |
+ dht_local_t *local = NULL;
|
|
|
e7a346 |
+ dht_conf_t *conf = NULL;
|
|
|
e7a346 |
char gfid[GF_UUID_BUF_SIZE] = {0};
|
|
|
e7a346 |
|
|
|
e7a346 |
VALIDATE_OR_GOTO (frame, err);
|
|
|
e7a346 |
@@ -1704,6 +1705,13 @@ dht_rename (call_frame_t *frame, xlator_t *this,
|
|
|
e7a346 |
VALIDATE_OR_GOTO (oldloc, err);
|
|
|
e7a346 |
VALIDATE_OR_GOTO (newloc, err);
|
|
|
e7a346 |
|
|
|
e7a346 |
+ conf = this->private;
|
|
|
e7a346 |
+
|
|
|
e7a346 |
+ if (conf->subvolume_cnt == 1) {
|
|
|
e7a346 |
+ default_rename (frame, this, oldloc, newloc, xdata);
|
|
|
e7a346 |
+ return 0;
|
|
|
e7a346 |
+ }
|
|
|
e7a346 |
+
|
|
|
e7a346 |
gf_uuid_unparse(oldloc->inode->gfid, gfid);
|
|
|
e7a346 |
|
|
|
e7a346 |
src_hashed = dht_subvol_get_hashed (this, oldloc);
|
|
|
e7a346 |
--
|
|
|
e7a346 |
1.8.3.1
|
|
|
e7a346 |
|