Whamcloud - gitweb
LU-6175 ha: add health_check routine to the MDS, MGS and OSD
[fs/lustre-release.git] / lustre / ost / ost_handler.c
index a35d2b0..e53b6ee 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -71,15 +71,15 @@ CFS_MODULE_PARM(oss_io_cpts, "s", charp, 0444,
 
 static struct cfs_cpt_table    *ost_io_cptable;
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
 LPROC_SEQ_FOPS_RO_TYPE(ost, uuid);
 
-static struct lprocfs_seq_vars lprocfs_ost_obd_vars[] = {
+static struct lprocfs_vars lprocfs_ost_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &ost_uuid_fops  },
-       { 0 }
+       { NULL }
 };
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */
 
 /* Sigh - really, this is an OSS, the _server_, not the _target_ */
 static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
@@ -90,7 +90,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
        int rc;
        ENTRY;
 
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
        obd->obd_vars = lprocfs_ost_obd_vars;
        lprocfs_obd_setup(obd);
 #endif
@@ -387,23 +387,17 @@ static int ost_cleanup(struct obd_device *obd)
 
 static int ost_health_check(const struct lu_env *env, struct obd_device *obd)
 {
-        struct ost_obd *ost = &obd->u.ost;
-        int rc = 0;
+       struct ost_obd *ost = &obd->u.ost;
+       int rc = 0;
 
        mutex_lock(&ost->ost_health_mutex);
-        rc |= ptlrpc_service_health_check(ost->ost_service);
-        rc |= ptlrpc_service_health_check(ost->ost_create_service);
-        rc |= ptlrpc_service_health_check(ost->ost_io_service);
+       rc |= ptlrpc_service_health_check(ost->ost_service);
+       rc |= ptlrpc_service_health_check(ost->ost_create_service);
+       rc |= ptlrpc_service_health_check(ost->ost_io_service);
+       rc |= ptlrpc_service_health_check(ost->ost_seq_service);
        mutex_unlock(&ost->ost_health_mutex);
 
-        /*
-         * health_check to return 0 on healthy
-         * and 1 on unhealthy.
-         */
-        if( rc != 0)
-                rc = 1;
-
-        return rc;
+       return rc != 0 ? 1 : 0;
 }
 
 /* use obd ops to offer management infrastructure */
@@ -422,9 +416,6 @@ static int __init ost_init(void)
        ENTRY;
 
        rc = class_register_type(&ost_obd_ops, NULL, true, NULL,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                NULL,
-#endif
                                 LUSTRE_OSS_NAME, NULL);
 
         if (ost_num_threads != 0 && oss_num_threads == 0) {