linux-bcachefs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Remove unnecessary kthread_should_stop()
@ 2023-12-16  1:51 Kevin Hao
  2023-12-19 13:01 ` Brian Foster
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hao @ 2023-12-16  1:51 UTC (permalink / raw)
  To: linux-bcachefs; +Cc: Kent Overstreet, Brian Foster

In the macro kthread_wait_freezable(), there is already a check for
kthread_should_stop(), so there is no need to pass kthread_should_stop()
as a parameter to kthread_wait_freezable().

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
 fs/bcachefs/movinggc.c  | 3 +--
 fs/bcachefs/rebalance.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index fd239a261aca..bc1ec877a66b 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -345,8 +345,7 @@ static int bch2_copygc_thread(void *arg)
 
 		if (!c->copy_gc_enabled) {
 			move_buckets_wait(&ctxt, buckets, true);
-			kthread_wait_freezable(c->copy_gc_enabled ||
-					       kthread_should_stop());
+			kthread_wait_freezable(c->copy_gc_enabled);
 		}
 
 		if (unlikely(freezing(current))) {
diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c
index ee452aa51a26..b83dd613e247 100644
--- a/fs/bcachefs/rebalance.c
+++ b/fs/bcachefs/rebalance.c
@@ -334,8 +334,7 @@ static int do_rebalance(struct moving_context *ctxt)
 	while (!bch2_move_ratelimit(ctxt)) {
 		if (!r->enabled) {
 			bch2_moving_ctxt_flush_all(ctxt);
-			kthread_wait_freezable(r->enabled ||
-					       kthread_should_stop());
+			kthread_wait_freezable(r->enabled);
 		}
 
 		if (kthread_should_stop())
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-04 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-16  1:51 [PATCH] bcachefs: Remove unnecessary kthread_should_stop() Kevin Hao
2023-12-19 13:01 ` Brian Foster
2023-12-19 20:55   ` Kent Overstreet
2024-01-04 11:49     ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).