Whamcloud - gitweb
LU-14895 client: allow case-insensitive checksum types
[fs/lustre-release.git] / lustre / ptlrpc / sec_config.c
index 22a230e..3f476ba 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
@@ -895,8 +894,9 @@ void sptlrpc_target_choose_flavor(struct sptlrpc_rule_set *rset,
  */
 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 ||
@@ -905,10 +905,7 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
        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() +
@@ -916,7 +913,6 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
                write_unlock(&imp->imp_sec_lock);
        }
 
-       up_read(&obd->u.cli.cl_sem);
        EXIT;
 }
 EXPORT_SYMBOL(sptlrpc_conf_client_adapt);