summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.h
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-07-21 16:38:14 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-10-10 08:58:39 +0000
commitc4a608799a577a4f38139f6bb8a47da8efb0fec3 (patch)
tree802a7a12349accd458bea79d5e43e7afad3a1802 /xlators/cluster/dht/src/dht-common.h
parentd4eb4ef28073fc8f5430802d9de9344e551711bb (diff)
cluster/dht: Don't store the entire uuid for subvols
Comparing the uuid string of the local node against that stored in the local_subvol information is inefficient, especially as it is done for every file to be migrated. The code has now been changed to set the value of info to 1 if the nodeuuid is that of the node making the comparison so this becomes an integer comparison. Change-Id: I7491d59caad3b71dbf5facc94dcde0cd53962775 BUG: 1451434 Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r--xlators/cluster/dht/src/dht-common.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 9b39596f872..f3e2c5cf41e 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -10,6 +10,7 @@
#include <regex.h>
#include <signal.h>
+#include <fnmatch.h>
#include "dht-mem-types.h"
#include "dht-messages.h"
@@ -47,10 +48,10 @@
*/
extern char *xattrs_to_heal[];
+/* Rebalance nodeuuid flags */
+#define REBAL_NODEUUID_MINE 0x01
-#include <fnmatch.h>
-
typedef int (*dht_selfheal_dir_cbk_t) (call_frame_t *frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
@@ -515,10 +516,15 @@ typedef struct gf_tier_conf {
char volname[GD_VOLUME_NAME_MAX + 1];
} gf_tier_conf_t;
-typedef struct subvol_nodeuuids {
- uuid_t *uuids;
+typedef struct nodeuuid_info {
+ char info; /* Set to 1 is this is my node's uuid*/
+ uuid_t uuid; /* Store the nodeuuid as well for debugging*/
+} nodeuuid_info_t;
+
+typedef struct subvol_nodeuuids_info {
+ nodeuuid_info_t *elements;
int count;
-} subvol_nodeuuid_t;
+} subvol_nodeuuids_info_t;
struct gf_defrag_info_ {
@@ -662,7 +668,7 @@ struct dht_conf {
/*local subvol storage for rebalance*/
xlator_t **local_subvols;
- subvol_nodeuuid_t *local_nodeuuids;
+ subvol_nodeuuids_info_t *local_nodeuuids;
int32_t local_subvols_cnt;
/*