* 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/
#define DEBUG_SUBSYSTEM S_OST
#include <linux/module.h>
-#include <obd_ost.h>
#include <lustre_dlm.h>
#include <lprocfs_status.h>
+#include <obd_class.h>
#include "ost_internal.h"
static int oss_num_threads;
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)
int rc;
ENTRY;
- rc = cfs_cleanup_group_info();
- if (rc)
- RETURN(rc);
-
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
obd->obd_vars = lprocfs_ost_obd_vars;
- lprocfs_seq_obd_setup(obd);
+ lprocfs_obd_setup(obd);
#endif
mutex_init(&ost->ost_health_mutex);
GOTO(out_seq, rc);
}
- /* Index read service */
- memset(&svc_conf, 0, sizeof(svc_conf));
- svc_conf = (typeof(svc_conf)) {
- .psc_name = "ost_idx_read",
- .psc_watchdog_factor = OSS_SERVICE_WATCHDOG_FACTOR,
- .psc_buf = {
- .bc_nbufs = OST_NBUFS,
- .bc_buf_size = OST_BUFSIZE,
- .bc_req_max_size = OST_MAXREQSIZE,
- .bc_rep_max_size = OST_MAXREPSIZE,
- .bc_req_portal = OST_IDX_PORTAL,
- .bc_rep_portal = OSC_REPLY_PORTAL,
- },
- .psc_thr = {
- .tc_thr_name = "ll_ost_idx",
- .tc_thr_factor = OSS_CR_THR_FACTOR,
- .tc_nthrs_init = OSS_CR_NTHRS_INIT,
- .tc_nthrs_base = OSS_CR_NTHRS_BASE,
- .tc_nthrs_max = OSS_CR_NTHRS_MAX,
- .tc_nthrs_user = oss_num_create_threads,
- .tc_cpu_affinity = 1,
- .tc_ctx_tags = LCT_DT_THREAD,
- },
- .psc_cpt = {
- .cc_pattern = oss_cpts,
- },
- .psc_ops = {
- .so_req_handler = tgt_request_handle,
- .so_req_printer = target_print_req,
- },
- };
- ost->ost_idx_service = ptlrpc_register_service(&svc_conf,
- obd->obd_proc_entry);
- if (IS_ERR(ost->ost_idx_service)) {
- rc = PTR_ERR(ost->ost_idx_service);
- CERROR("failed to start OST index read service: rc = %d\n", rc);
- ost->ost_idx_service = NULL;
- GOTO(out_out, rc);
- }
-
ping_evictor_start();
RETURN(0);
-out_out:
- ptlrpc_unregister_service(ost->ost_out_service);
- ost->ost_out_service = NULL;
out_seq:
ptlrpc_unregister_service(ost->ost_seq_service);
ost->ost_seq_service = NULL;
ptlrpc_unregister_service(ost->ost_io_service);
ptlrpc_unregister_service(ost->ost_seq_service);
ptlrpc_unregister_service(ost->ost_out_service);
- ptlrpc_unregister_service(ost->ost_idx_service);
ost->ost_service = NULL;
ost->ost_create_service = NULL;
ost->ost_io_service = NULL;
ost->ost_seq_service = NULL;
ost->ost_out_service = NULL;
- ost->ost_idx_service = NULL;
mutex_unlock(&ost->ost_health_mutex);
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 */
ENTRY;
- rc = class_register_type(&ost_obd_ops, NULL, NULL,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL,
-#endif
- LUSTRE_OSS_NAME, NULL);
+ rc = class_register_type(&ost_obd_ops, NULL, true, NULL,
+ LUSTRE_OSS_NAME, NULL);
if (ost_num_threads != 0 && oss_num_threads == 0) {
LCONSOLE_INFO("ost_num_threads module parameter is deprecated, "