summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-05-22 16:13:40 +0300
committerChristian Brauner <brauner@kernel.org>2026-05-27 16:11:02 +0300
commit99489cd82cae65a057be662eff7bc4f3af6b0498 (patch)
tree83c1cba6f8aa1cddfde46ec007840eb5fa63725c
parentec3f4e0443a61e68092ac07111f16dd4ca89ddb4 (diff)
parent2fddb8479d000aca35ed34243982a9ba141808c4 (diff)
downloadlinux-99489cd82cae65a057be662eff7bc4f3af6b0498.tar.xz
Merge patch series "fs: refactor code to use clear_and_wake_up_bit()"
Agatha Isabelle Moreira <code@agatha.dev> says: Refactor code to use `clear_and_wake_up_bit()` instead of manual calls to: clear_bit_unlock(); smp_mb__after_atomic(); wake_up_bit(); The helper function `clear_and_wake_up_bit()` was introduced in 'commit 8236b0ae31c83 ("bdi: wake up concurrent wb_shutdown() callers.")' as a generic way of doing the same sequence of operations, but several pieces of code still remain. Replace manual calls to the operations by a single call to `clear_and_wake_up_bit()` to deduplicate code and standardize pathways. * patches from https://patch.msgid.link/ag4PEP52c8rxrYPc@guidai: fs: jbd2: use clear_and_wake_up_bit() in journal_end_buffer_io_sync() fs: buffer: use clear_and_wake_up_bit() in unlock_buffer() Link: https://patch.msgid.link/ag4PEP52c8rxrYPc@guidai Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
-rw-r--r--fs/buffer.c4
-rw-r--r--fs/jbd2/commit.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index b0b3792b1496..4348b240bd97 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -74,9 +74,7 @@ EXPORT_SYMBOL(__lock_buffer);
void unlock_buffer(struct buffer_head *bh)
{
- clear_bit_unlock(BH_Lock, &bh->b_state);
- smp_mb__after_atomic();
- wake_up_bit(&bh->b_state, BH_Lock);
+ clear_and_wake_up_bit(BH_Lock, &bh->b_state);
}
EXPORT_SYMBOL(unlock_buffer);
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 8cf61e7185c4..b647fde76e49 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -39,9 +39,7 @@ static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
else
clear_buffer_uptodate(bh);
if (orig_bh) {
- clear_bit_unlock(BH_Shadow, &orig_bh->b_state);
- smp_mb__after_atomic();
- wake_up_bit(&orig_bh->b_state, BH_Shadow);
+ clear_and_wake_up_bit(BH_Shadow, &orig_bh->b_state);
}
unlock_buffer(bh);
}