struct obd_connect_data *ocd;
struct lustre_handle conn = { 0 };
int rc;
- bool is_mdc = false;
ENTRY;
*exp = NULL;
ocd = &imp->imp_connect_data;
if (data) {
*ocd = *data;
- is_mdc = strncmp(imp->imp_obd->obd_type->typ_name,
- LUSTRE_MDC_NAME, 3) == 0;
- if (is_mdc)
- data->ocd_connect_flags |= OBD_CONNECT_MULTIMODRPCS;
imp->imp_connect_flags_orig = data->ocd_connect_flags;
imp->imp_connect_flags2_orig = data->ocd_connect_flags2;
}
rc = ptlrpc_connect_import(imp);
if (rc != 0) {
- if (data && is_mdc)
- data->ocd_connect_flags &= ~OBD_CONNECT_MULTIMODRPCS;
LASSERT(imp->imp_state == LUSTRE_IMP_DISCON);
GOTO(out_ldlm, rc);
}
ocd->ocd_connect_flags, "old %#llx, new %#llx\n",
data->ocd_connect_flags, ocd->ocd_connect_flags);
data->ocd_connect_flags = ocd->ocd_connect_flags;
- /* clear the flag as it was not set and is not known
- * by upper layers */
- if (is_mdc)
- data->ocd_connect_flags &= ~OBD_CONNECT_MULTIMODRPCS;
}
ptlrpc_pinger_add_import(imp);
}
now = cfs_time_current();
- deadline = cfs_timer_deadline(&target->obd_recovery_timer);
+ deadline = target->obd_recovery_timer.expires;
if (cfs_time_before(now, deadline)) {
struct target_distribute_txn_data *tdtd =
class_exp2tgt(exp)->lut_tdtd;
i = atomic_read(&target->obd_lock_replay_clients);
k = target->obd_max_recoverable_clients;
s = target->obd_stale_clients;
- t = cfs_timer_deadline(&target->obd_recovery_timer);
+ t = target->obd_recovery_timer.expires;
t = cfs_time_sub(t, cfs_time_current());
t = cfs_duration_sec(t);
LCONSOLE_WARN("%s: Denying connection for new client %s"
void target_cancel_recovery_timer(struct obd_device *obd)
{
CDEBUG(D_HA, "%s: cancel recovery timer\n", obd->obd_name);
- cfs_timer_disarm(&obd->obd_recovery_timer);
+ del_timer(&obd->obd_recovery_timer);
}
static void target_start_recovery_timer(struct obd_device *obd)
return;
}
- cfs_timer_arm(&obd->obd_recovery_timer,
- cfs_time_shift(obd->obd_recovery_timeout));
+ mod_timer(&obd->obd_recovery_timer,
+ cfs_time_shift(obd->obd_recovery_timeout));
obd->obd_recovery_start = cfs_time_current_sec();
spin_unlock(&obd->obd_dev_lock);
if (obd->obd_recovery_timeout < to) {
obd->obd_recovery_timeout = to;
end = obd->obd_recovery_start + to;
- cfs_timer_arm(&obd->obd_recovery_timer,
- cfs_time_shift(end - now));
+ mod_timer(&obd->obd_recovery_timer,
+ cfs_time_shift(end - now));
}
spin_unlock(&obd->obd_dev_lock);
obd->obd_recovery_start = 0;
obd->obd_recovery_end = 0;
- cfs_timer_init(&obd->obd_recovery_timer, target_recovery_expired, obd);
- target_start_recovery_thread(lut, handler);
+ setup_timer(&obd->obd_recovery_timer, target_recovery_expired,
+ (unsigned long)obd);
+ target_start_recovery_thread(lut, handler);
}
EXPORT_SYMBOL(target_recovery_init);