From c4a608799a577a4f38139f6bb8a47da8efb0fec3 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Fri, 21 Jul 2017 16:38:14 +0530 Subject: 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 --- xlators/cluster/dht/src/dht-common.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.h') 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 #include +#include #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 - 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; /* -- cgit