*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2013, 2015, Intel Corporation.
+ * Copyright (c) 2013, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/*********** mount lookup *********/
static DEFINE_MUTEX(lustre_mount_info_lock);
-static struct list_head server_mount_info_list =
- LIST_HEAD_INIT(server_mount_info_list);
+static LIST_HEAD(server_mount_info_list);
static struct lustre_mount_info *server_find_mount(const char *name)
{
}
EXPORT_SYMBOL(tgt_name2lwp_name);
-static struct list_head lwp_register_list =
- LIST_HEAD_INIT(lwp_register_list);
+static LIST_HEAD(lwp_register_list);
static DEFINE_SPINLOCK(lwp_register_list_lock);
static void lustre_put_lwp_item(struct lwp_register_item *lri)
{
struct obd_device *lwp;
struct lwp_register_item *lri;
+ bool cb = false;
ENTRY;
LASSERTF(strlen(lwpname) < MTI_NAME_MAXLEN, "lwpname is too long %s\n",
spin_lock(&lwp_register_list_lock);
list_add(&lri->lri_list, &lwp_register_list);
+ if (*exp != NULL)
+ cb = true;
spin_unlock(&lwp_register_list_lock);
- if (*exp != NULL && cb_func != NULL)
+ if (cb && cb_func != NULL)
cb_func(cb_data);
lustre_put_lwp_item(lri);
if (*lri->lri_exp != NULL)
continue;
*lri->lri_exp = class_export_get(exp);
+ if (lri->lri_cb_func == NULL)
+ continue;
atomic_inc(&lri->lri_ref);
spin_unlock(&lwp_register_list_lock);
- if (lri->lri_cb_func != NULL)
- lri->lri_cb_func(lri->lri_cb_data);
+ lri->lri_cb_func(lri->lri_cb_data);
lustre_put_lwp_item(lri);
/* Others may have changed the list after we unlock, we have
static int server_lsi2mti(struct lustre_sb_info *lsi,
struct mgs_target_info *mti)
{
- lnet_process_id_t id;
+ struct lnet_process_id id;
int rc, i = 0;
int cplen = 0;
ENTRY;
/* Start targets using the llog named for the target */
memset(&cfg, 0, sizeof(cfg));
cfg.cfg_callback = class_config_llog_handler;
+ cfg.cfg_sub_clds = CONFIG_SUB_SERVER;
rc = lustre_process_log(sb, lsi->lsi_svname, &cfg);
if (rc) {
CERROR("failed to start server %s: %d\n",
/* calculate recovery timeout, do it after lustre_process_log */
server_calc_timeout(lsi, obd);
- /* log has been fully processed */
- obd_notify(obd, NULL, OBD_NOTIFY_CONFIG, (void *)CONFIG_LOG);
-
/* log has been fully processed, let clients connect */
dev = obd->obd_lu_dev;
if (dev && dev->ld_ops->ldo_prepare) {
if (has_ir) {
int new_soft = soft;
- int new_hard = hard;
/* adjust timeout value by imperative recovery */
-
new_soft = (soft * factor) / OBD_IR_FACTOR_MAX;
- new_hard = (hard * factor) / OBD_IR_FACTOR_MAX;
-
/* make sure the timeout is not too short */
new_soft = max(min, new_soft);
- new_hard = max(new_soft, new_hard);
LCONSOLE_INFO("%s: Imperative Recovery enabled, recovery "
"window shrunk from %d-%d down to %d-%d\n",
- obd->obd_name, soft, hard, new_soft, new_hard);
+ obd->obd_name, soft, hard, new_soft, hard);
soft = new_soft;
- hard = new_hard;
+ } else {
+ LCONSOLE_INFO("%s: Imperative Recovery not enabled, recovery "
+ "window %d-%d\n", obd->obd_name, soft, hard);
}
/* we're done */
- obd->obd_recovery_timeout = max(obd->obd_recovery_timeout, soft);
+ obd->obd_recovery_timeout = max_t(time64_t, obd->obd_recovery_timeout,
+ soft);
obd->obd_recovery_time_hard = hard;
obd->obd_recovery_ir_factor = factor;
}