[PATCH] Remove redundant default-config code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We were checking 'hold_timeout == 0' in 3 different places when setting up
the default totem config.
---

 exec/totemconfig.c |   20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index 981f328..f6113e6 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -68,8 +68,6 @@

 #define TOKEN_RETRANSMITS_BEFORE_LOSS_CONST	4
 #define TOKEN_TIMEOUT				1000
-#define TOKEN_RETRANSMIT_TIMEOUT		(int)(TOKEN_TIMEOUT /
(TOKEN_RETRANSMITS_BEFORE_LOSS_CONST + 0.2))
-#define TOKEN_HOLD_TIMEOUT			(int)(TOKEN_RETRANSMIT_TIMEOUT * 0.8 -
(1000/(int)HZ))
 #define JOIN_TIMEOUT				50
 #define MERGE_TIMEOUT				200
 #define DOWNCHECK_TIMEOUT			1000
@@ -507,20 +505,6 @@ int totem_config_validate (
 	 */
 	if (totem_config->token_timeout == 0) {
 		totem_config->token_timeout = TOKEN_TIMEOUT;
-		if (totem_config->token_retransmits_before_loss_const == 0) {
-			totem_config->token_retransmits_before_loss_const =
TOKEN_RETRANSMITS_BEFORE_LOSS_CONST;
-		}
-
-		if (totem_config->token_retransmit_timeout == 0) {
-			totem_config->token_retransmit_timeout =
-				(int)(totem_config->token_timeout /
-				(totem_config->token_retransmits_before_loss_const + 0.2));
-		}
-		if (totem_config->token_hold_timeout == 0) {
-			totem_config->token_hold_timeout =
-				(int)(totem_config->token_retransmit_timeout * 0.8 -
-				(1000/HZ));
-		}
 	}

 	if (totem_config->max_network_delay == 0) {
@@ -570,10 +554,6 @@ int totem_config_validate (
 		goto parse_error;
 	}

-	if (totem_config->token_hold_timeout == 0) {
-		totem_config->token_hold_timeout = TOKEN_HOLD_TIMEOUT;
-	}
-
 	if (totem_config->token_hold_timeout < MINIMUM_TIMEOUT) {
 		snprintf (local_error_reason, sizeof(local_error_reason),
 			"The token hold timeout parameter (%d ms) may not be less then (%d ms).",

Attachment: rm-redundant-default-config.patch
Description: Binary data

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss

[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux