mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ksmbd: use clear_and_wake_up_bit() in wake_up_oplock_break()
@ 2026-09-30 18:37 Daijiamu
  2026-10-01  2:51 ` ChenXiaoSong
  0 siblings, 1 reply; 2+ messages in thread
From: Daijiamu @ 2026-09-30 18:37 UTC (permalink / raw)
  To: linkinjeon, sergey.senozhatsky, tom
  Cc: chenxiaosong, linux-cifs, linux-kernel, Daijiamu

clear_and_wake_up_bit() was introduced by commit 8236b0ae31c8 ("bdi:
wake up concurrent wb_shutdown() callers.") to replace the open-coded
clear_bit_unlock() + smp_mb__after_atomic() + wake_up_bit() sequence.

Use the helper in wake_up_oplock_break() to standardize the code path.

Signed-off-by: Daijiamu <3058704216@qq.com>
---
 fs/smb/server/oplock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c
index 1b8c3482d1e4..bbf84b05dcf7 100644
--- a/fs/smb/server/oplock.c
+++ b/fs/smb/server/oplock.c
@@ -765,10 +765,7 @@ static bool wait_for_break_ack(struct oplock_info *opinfo)
 
 static void wake_up_oplock_break(struct oplock_info *opinfo)
 {
-	clear_bit_unlock(0, &opinfo->pending_break);
-	/* memory barrier is needed for wake_up_bit() */
-	smp_mb__after_atomic();
-	wake_up_bit(&opinfo->pending_break, 0);
+	clear_and_wake_up_bit(0, &opinfo->pending_break);
 }
 
 static bool oplock_break_set_ack_wait(struct oplock_info *opinfo)
-- 
2.55.0


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

* Re: [PATCH] ksmbd: use clear_and_wake_up_bit() in wake_up_oplock_break()
  2026-09-30 18:37 [PATCH] ksmbd: use clear_and_wake_up_bit() in wake_up_oplock_break() Daijiamu
@ 2026-10-01  2:51 ` ChenXiaoSong
  0 siblings, 0 replies; 2+ messages in thread
From: ChenXiaoSong @ 2026-10-01  2:51 UTC (permalink / raw)
  To: Daijiamu, linkinjeon, sergey.senozhatsky, tom; +Cc: linux-cifs, linux-kernel

We can remove wake_up_oplock_break() now as well, call 
clear_and_wake_up_bit() directly.

On 10/1/26 02:37, Daijiamu wrote:
>   static void wake_up_oplock_break(struct oplock_info *opinfo)
>   {
> -	clear_bit_unlock(0, &opinfo->pending_break);
> -	/* memory barrier is needed for wake_up_bit() */
> -	smp_mb__after_atomic();
> -	wake_up_bit(&opinfo->pending_break, 0);
> +	clear_and_wake_up_bit(0, &opinfo->pending_break);
>   }

-- 
ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en


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

end of thread, other threads:[~2026-10-01  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 18:37 [PATCH] ksmbd: use clear_and_wake_up_bit() in wake_up_oplock_break() Daijiamu
2026-10-01  2:51 ` ChenXiaoSong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®