Whamcloud - gitweb
b=11512
authorcliffw <cliffw>
Wed, 9 May 2007 20:37:34 +0000 (20:37 +0000)
committercliffw <cliffw>
Wed, 9 May 2007 20:37:34 +0000 (20:37 +0000)
i=wangdi
i=shadow

Removes write from health check, adds option to configure.

lustre/autoconf/lustre-core.m4
lustre/mds/handler.c
lustre/obdfilter/filter.c

index 20e788f..2a8a086 100644 (file)
@@ -399,6 +399,23 @@ fi
 ])
 
 #
+# LC_CONFIG_HEALTH_CHECK_WRITE
+#
+# Turn off the actual write to the disk
+#
+AC_DEFUN([LC_CONFIG_HEALTH_CHECK_WRITE],
+[AC_MSG_CHECKING([whether to enable a write with the health check])
+AC_ARG_ENABLE([health_write],
+        AC_HELP_STRING([--disable-health_write],
+                        [disable disk writes when doing health check]),
+        [],[enable_health_write='yes'])
+AC_MSG_RESULT([$enable_health_write])
+if test x$enable_health_write != xno ; then
+  AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, Write when Checking Health)
+fi
+])
+
+#
 # LC_CONFIG_LIBLUSTRE_RECOVERY
 #
 AC_DEFUN([LC_CONFIG_LIBLUSTRE_RECOVERY],
@@ -1042,6 +1059,7 @@ fi
 LC_CONFIG_PINGER
 LC_CONFIG_LIBLUSTRE_RECOVERY
 LC_CONFIG_QUOTA
+LC_CONFIG_HEALTH_CHECK_WRITE
 
 LC_TASK_PPTR
 
index c53b906..3a99194 100644 (file)
@@ -2652,14 +2652,18 @@ static struct dentry *mds_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr,
 static int mds_health_check(struct obd_device *obd)
 {
         struct obd_device_target *odt = &obd->u.obt;
+#ifdef USE_HEALTH_CHECK_WRITE
         struct mds_obd *mds = &obd->u.mds;
+#endif
         int rc = 0;
 
         if (odt->obt_sb->s_flags & MS_RDONLY)
                 rc = 1;
 
+#ifdef USE_HEALTH_CHECK_WRITE
         LASSERT(mds->mds_health_check_filp != NULL);
         rc |= !!lvfs_check_io_health(obd, mds->mds_health_check_filp);
+#endif
 
         return rc;
 }
index cbbafbc..6974d87 100644 (file)
@@ -3329,7 +3329,9 @@ int filter_iocontrol(unsigned int cmd, struct obd_export *exp,
 
 static int filter_health_check(struct obd_device *obd)
 {
+#ifdef USE_HEALTH_CHECK_WRITE
         struct filter_obd *filter = &obd->u.filter;
+#endif
         int rc = 0;
 
         /*
@@ -3339,8 +3341,10 @@ static int filter_health_check(struct obd_device *obd)
         if (obd->u.obt.obt_sb->s_flags & MS_RDONLY)
                 rc = 1;
 
+#ifdef USE_HEALTH_CHECK_WRITE
         LASSERT(filter->fo_health_check_filp != NULL);
         rc |= !!lvfs_check_io_health(obd, filter->fo_health_check_filp);
+#endif
 
         return rc;
 }