*
* 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) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/* XXX belongs in setup not attach */
init_rwsem(&obd->obd_observer_link_sem);
/* recovery data */
- cfs_init_timer(&obd->obd_recovery_timer);
+ init_timer(&obd->obd_recovery_timer);
spin_lock_init(&obd->obd_recovery_task_lock);
init_waitqueue_head(&obd->obd_next_transno_waitq);
init_waitqueue_head(&obd->obd_evict_inprogress_waitq);
[2] = param,
[3] = NULL
};
- struct timeval start;
- struct timeval end;
+ ktime_t start;
+ ktime_t end;
int rc;
ENTRY;
RETURN(-EINVAL);
}
- do_gettimeofday(&start);
+ start = ktime_get();
rc = call_usermodehelper(argv[0], argv, NULL, UMH_WAIT_PROC);
- do_gettimeofday(&end);
+ end = ktime_get();
if (rc < 0) {
CERROR("lctl: error invoking upcall %s %s %s: rc = %d; "
"time %ldus\n", argv[0], argv[1], argv[2], rc,
- cfs_timeval_sub(&end, &start, NULL));
+ (long)ktime_us_delta(end, start));
} else {
CDEBUG(D_HA, "lctl: invoked upcall %s %s %s, time %ldus\n",
argv[0], argv[1], argv[2],
- cfs_timeval_sub(&end, &start, NULL));
+ (long)ktime_us_delta(end, start));
rc = 0;
}
lcfg->lcfg_command = LCFG_LOV_ADD_INA;
}
+ lustre_cfg_bufs_reset(&bufs, NULL);
lustre_cfg_bufs_init(&bufs, lcfg);
if (cfg->cfg_instance &&
cfg->cfg_obdname);
}
+ /* Add net info to setup command
+ * if given on command line.
+ * So config log will be:
+ * [0]: client name
+ * [1]: client UUID
+ * [2]: server UUID
+ * [3]: inactive-on-startup
+ * [4]: restrictive net
+ */
+ if (cfg && cfg->cfg_sb && s2lsi(cfg->cfg_sb) &&
+ !IS_SERVER(s2lsi(cfg->cfg_sb))) {
+ struct lustre_sb_info *lsi = s2lsi(cfg->cfg_sb);
+ char *nidnet = lsi->lsi_lmd->lmd_nidnet;
+
+ if (lcfg->lcfg_command == LCFG_SETUP &&
+ lcfg->lcfg_bufcount != 2 && nidnet) {
+ CDEBUG(D_CONFIG, "Adding net %s info to setup "
+ "command for client %s\n", nidnet,
+ lustre_cfg_string(lcfg, 0));
+ lustre_cfg_bufs_set_string(&bufs, 4, nidnet);
+ }
+ }
+
+ /* Skip add_conn command if uuid is
+ * not on restricted net */
+ if (cfg && cfg->cfg_sb && s2lsi(cfg->cfg_sb) &&
+ !IS_SERVER(s2lsi(cfg->cfg_sb))) {
+ struct lustre_sb_info *lsi = s2lsi(cfg->cfg_sb);
+ char *uuid_str = lustre_cfg_string(lcfg, 1);
+
+ if (lcfg->lcfg_command == LCFG_ADD_CONN &&
+ lsi->lsi_lmd->lmd_nidnet &&
+ LNET_NIDNET(libcfs_str2nid(uuid_str)) !=
+ libcfs_str2net(lsi->lsi_lmd->lmd_nidnet)) {
+ CDEBUG(D_CONFIG, "skipping add_conn for %s\n",
+ uuid_str);
+ rc = 0;
+ /* No processing! */
+ break;
+ }
+ }
+
lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs);
if (lcfg_new == NULL)
GOTO(out, rc = -ENOMEM);
lcfg_new->lcfg_num = lcfg->lcfg_num;
lcfg_new->lcfg_flags = lcfg->lcfg_flags;
- /* XXX Hack to try to remain binary compatible with
- * pre-newconfig logs */
+ /* XXX Hack to try to remain binary compatible with
+ * pre-newconfig logs */
if (lcfg->lcfg_nal != 0 && /* pre-newconfig log? */
(lcfg->lcfg_nid >> 32) == 0) {
__u32 addr = (__u32)(lcfg->lcfg_nid & 0xffffffff);
}
default:
CERROR("Unknown llog record type %#x encountered\n",
- rec->lrh_type);
+ rec->lrh_type);
break;
}
out:
int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
char *name, struct config_llog_instance *cfg)
{
- struct llog_process_cat_data cd = {0, 0};
- struct llog_handle *llh;
- llog_cb_t callback;
- int rc;
+ struct llog_process_cat_data cd = {
+ .lpcd_first_idx = 0,
+ };
+ struct llog_handle *llh;
+ llog_cb_t callback;
+ int rc;
ENTRY;
CDEBUG(D_INFO, "looking up llog %s\n", name);