From c404dfb40c2b83c869cbe14c9a618e734c0f2db6 Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 9 Sep 2008 06:05:00 +0000 Subject: [PATCH] - fix slow increasing of recovery time b:16389 i:nathan, rread --- lustre/include/lustre_import.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lustre/include/lustre_import.h b/lustre/include/lustre_import.h index f515d95..96d5f8b 100644 --- a/lustre/include/lustre_import.h +++ b/lustre/include/lustre_import.h @@ -172,6 +172,18 @@ struct obd_import { }; /* import.c */ +static inline unsigned int at_est2timeout(unsigned int val) +{ + /* add an arbitrary minimum: 125% +5 sec */ + return (val + (val >> 2) + 5); +} + +static inline unsigned int at_timeout2est(unsigned int val) +{ + /* restore estimate value from timeout */ + return ((val - 1) / 5 * 4); +} + static inline void at_init(struct adaptive_timeout *at, int val, int flags) { memset(at, 0, sizeof(*at)); at->at_current = val; -- 1.8.3.1