Skip to contentSkip to conversation

security: tomoyo: simplify the gc kthread creation

PATCH In review Mike Danese 3 participants 3 messages May 20, 2016 – Jun 6, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security: tomoyo: simplify the gc kthread creation

The code is doing the equivalent of the kthread_run macro.

---
 security/tomoyo/gc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
security/tomoyo/gc.c +2 -7
index 986a6a7..540bc29 100644
@@ -645,11 +645,6 @@ void tomoyo_notify_gc(struct tomoyo_io_buffer *head, const bool is_register)
 		}
 	}
 	spin_unlock(&tomoyo_io_buffer_list_lock);
-	if (is_write) {
-		struct task_struct *task = kthread_create(tomoyo_gc_thread,
-							  NULL,
-							  "GC for TOMOYO");
-		if (!IS_ERR(task))
-			wake_up_process(task);
-	}
+	if (is_write)
+		kthread_run(tomoyo_gc_thread, NULL, "GC for TOMOYO");
 }
Signature · 1 line
2.5.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mike Danese

The code is doing the equivalent of the kthread_run macro.

Quoted 26 lines
---
 security/tomoyo/gc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
security/tomoyo/gc.c +2 -7
index 986a6a7..540bc29 100644
@@ -645,11 +645,6 @@ void tomoyo_notify_gc(struct tomoyo_io_buffer *head, const bool is_register)
 		}
 	}
 	spin_unlock(&tomoyo_io_buffer_list_lock);
-	if (is_write) {
-		struct task_struct *task = kthread_create(tomoyo_gc_thread,
-							  NULL,
-							  "GC for TOMOYO");
-		if (!IS_ERR(task))
-			wake_up_process(task);
-	}
+	if (is_write)
+		kthread_run(tomoyo_gc_thread, NULL, "GC for TOMOYO");
 }
Signature · 1 line
2.5.0