*
* 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/
{
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
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 */