From 8cf2f9d1fa3fbd46b929a8717aa8c50f459534b1 Mon Sep 17 00:00:00 2001
From: bobijam <bobijam>
Date: Tue, 15 Jul 2008 02:13:33 +0000
Subject: [PATCH] Branch b1_6 b=16205 i=johann, sheng.yang

use a macro defining ldlm timeout value on MDS.
---
 lustre/include/obd_support.h | 5 +++--
 lustre/mds/handler.c         | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h
index 066a3f3f93..cc6e5dbc1e 100644
--- a/lustre/include/obd_support.h
+++ b/lustre/include/obd_support.h
@@ -53,8 +53,9 @@ extern int obd_race_state;
 extern unsigned int obd_alloc_fail_rate;
 
 /* Timeout definitions */
-#define OBD_TIMEOUT_DEFAULT 100
-#define LDLM_TIMEOUT_DEFAULT 20
+#define OBD_TIMEOUT_DEFAULT             100
+#define LDLM_TIMEOUT_DEFAULT            20
+#define MDS_LDLM_TIMEOUT_DEFAULT        6
 #ifdef CRAY_XT3
  #define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */
 #endif
diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c
index 7d70520ad6..d62d9b4e01 100644
--- a/lustre/mds/handler.c
+++ b/lustre/mds/handler.c
@@ -2087,8 +2087,11 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
                               obd->obd_replayable ? "enabled" : "disabled");
         }
 
+        /* Reduce the initial timeout on an MDS because it doesn't need such
+         * a long timeout as an OST does. Adaptive timeouts will adjust this
+         * value appropriately. */
         if (ldlm_timeout == LDLM_TIMEOUT_DEFAULT)
-                ldlm_timeout = 6;
+                ldlm_timeout = MDS_LDLM_TIMEOUT_DEFAULT;
 
         RETURN(0);
 
-- 
GitLab