From fb034ba3036fadc7cf35edc5cae7481149a67ca0 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 9 Apr 2009 03:54:51 -0700 Subject: Compulsorily do self heal if file sizes differ. If file sizes differ, then compulsorily do self-heal. If no 'wise' sources are found, then pick a 'fool' with the biggest file size. If even 'fools' aren't found, pick the 'innocent' source with the biggest file size. Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr-self-heal-common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.h') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.h b/xlators/cluster/afr/src/afr-self-heal-common.h index df786e99924..86f155b6897 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.h +++ b/xlators/cluster/afr/src/afr-self-heal-common.h @@ -22,6 +22,12 @@ #define FILE_HAS_HOLES(buf) (((buf)->st_size) > ((buf)->st_blocks * 512)) +typedef enum { + AFR_SELF_HEAL_ENTRY, + AFR_SELF_HEAL_METADATA, + AFR_SELF_HEAL_DATA, +} afr_self_heal_type; + int afr_sh_select_source (int sources[], int child_count); @@ -52,8 +58,8 @@ afr_sh_pending_to_delta (dict_t **xattr, char *key, int32_t *delta_matrix[], int32_t success[], int child_count); int -afr_sh_mark_sources (int32_t *pending_matrix[], int sources[], - int child_count); +afr_sh_mark_sources (afr_self_heal_t *sh, int child_count, + afr_self_heal_type type); int afr_sh_delta_to_xattr (int32_t *delta_matrix[], dict_t *xattr[], -- cgit