Whamcloud - gitweb
LU-8450 nodemap: modify ldlm_revoke_export_locks 20/23120/3
authorKit Westneat <kit.westneat@gmail.com>
Wed, 12 Oct 2016 22:16:14 +0000 (18:16 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 21 Oct 2016 15:00:59 +0000 (15:00 +0000)
Modify ldlm_revoke_export_locks to use cfs_hash_for_each_nolock
instead of cfs_hash_for_each_empty, to avoid looping multiple times
over the export hash.

Signed-off-by: Kit Westneat <kit.westneat@gmail.com>
Change-Id: I8ab475b8117493ed55961e94e747b4955141f003
Reviewed-on: http://review.whamcloud.com/23120
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lockd.c

index 13eb04b..89346ad 100644 (file)
@@ -2518,15 +2518,15 @@ static int ldlm_revoke_lock_cb(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 void ldlm_revoke_export_locks(struct obd_export *exp)
 {
        struct list_head  rpc_list;
-        ENTRY;
+       ENTRY;
 
        INIT_LIST_HEAD(&rpc_list);
-        cfs_hash_for_each_empty(exp->exp_lock_hash,
-                                ldlm_revoke_lock_cb, &rpc_list);
-        ldlm_run_ast_work(exp->exp_obd->obd_namespace, &rpc_list,
-                          LDLM_WORK_REVOKE_AST);
+       cfs_hash_for_each_nolock(exp->exp_lock_hash,
+                                ldlm_revoke_lock_cb, &rpc_list, 0);
+       ldlm_run_ast_work(exp->exp_obd->obd_namespace, &rpc_list,
+                         LDLM_WORK_REVOKE_AST);
 
-        EXIT;
+       EXIT;
 }
 EXPORT_SYMBOL(ldlm_revoke_export_locks);
 #endif /* HAVE_SERVER_SUPPORT */