Whamcloud - gitweb
LU-16322: build: Add client build support for openEuler
[fs/lustre-release.git] / lustre / ptlrpc / sec_gc.c
index 474a730..c056aa4 100644 (file)
@@ -75,8 +75,6 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
        if (list_empty(&sec->ps_gc_list))
                return;
 
-       might_sleep();
-
        /* signal before list_del to make iteration in gc thread safe */
        atomic_inc(&sec_gc_wait_del);
 
@@ -116,9 +114,9 @@ static void sec_process_ctx_list(void)
 
        spin_lock(&sec_gc_ctx_list_lock);
 
-       while (!list_empty(&sec_gc_ctx_list)) {
-               ctx = list_entry(sec_gc_ctx_list.next,
-                                    struct ptlrpc_cli_ctx, cc_gc_chain);
+       while ((ctx = list_first_entry_or_null(&sec_gc_ctx_list,
+                                              struct ptlrpc_cli_ctx,
+                                              cc_gc_chain)) != NULL) {
                list_del_init(&ctx->cc_gc_chain);
                spin_unlock(&sec_gc_ctx_list_lock);