*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*/
#define DEBUG_SUBSYSTEM S_SEC
*/
void sptlrpc_conf_client_adapt(struct obd_device *obd)
{
- struct obd_import *imp;
- ENTRY;
+ struct obd_import *imp;
+ int rc;
+ ENTRY;
LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
CDEBUG(D_SEC, "obd %s\n", obd->u.cli.cl_target_uuid.uuid);
/* serialize with connect/disconnect import */
- down_read_nested(&obd->u.cli.cl_sem, OBD_CLI_SEM_MDCOSC);
-
- imp = obd->u.cli.cl_import;
- if (imp) {
+ with_imp_locked_nested(obd, imp, rc, OBD_CLI_SEM_MDCOSC) {
write_lock(&imp->imp_sec_lock);
if (imp->imp_sec)
imp->imp_sec_expire = ktime_get_real_seconds() +
write_unlock(&imp->imp_sec_lock);
}
- up_read(&obd->u.cli.cl_sem);
EXIT;
}
EXPORT_SYMBOL(sptlrpc_conf_client_adapt);