Whamcloud - gitweb
LU-544 speed up filesystem formatting time in conf-sanity.sh
authorYu Jian <yujian@whamcloud.com>
Thu, 11 Aug 2011 10:34:27 +0000 (18:34 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 16 Aug 2011 00:16:17 +0000 (20:16 -0400)
Pass "-E lazy_itable_init" to mke2fs to speed up Lustre
filesystem formatting time in conf-sanity.sh.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I29070e6c4b95028b12573d552a32ca04189c2c1d
Reviewed-on: http://review.whamcloud.com/1210
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/tests/conf-sanity.sh

index f55c2f4..a2069e5 100644 (file)
@@ -49,6 +49,16 @@ if [ -n "$MDSSIZE" ]; then
     STORED_MDSSIZE=$MDSSIZE
 fi
 
+# pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
+for facet in MGS MDS OST; do
+    opts=${facet}_MKFS_OPTS
+    if [[ ${!opts} != *lazy_itable_init* ]]; then
+        eval SAVED_${facet}_MKFS_OPTS=\"${!opts}\"
+        eval ${facet}_MKFS_OPTS=\"${!opts} \
+--mkfsoptions='\\\"-E lazy_itable_init\\\"'\"
+    fi
+done
+
 init_logging
 
 #
@@ -2760,5 +2770,13 @@ fi
 
 cleanup_gss
 
+# restore the ${facet}_MKFS_OPTS variables
+for facet in MGS MDS OST; do
+    opts=SAVED_${facet}_MKFS_OPTS
+    if [[ -n ${!opts} ]]; then
+        eval ${facet}_MKFS_OPTS=\"${!opts}\"
+    fi
+done
+
 complete $(basename $0) $SECONDS
 exit_status