]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: use clear_and_wake_up_bit() where open coded
authorDavid Sterba <dsterba@suse.com>
Tue, 8 Jul 2025 14:49:52 +0000 (16:49 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 22:09:21 +0000 (00:09 +0200)
There are two cases open coding the clear and wake up pattern, we can
use the helper.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index cc7f04d56a1039feb28bb9d4fa4b369c0f25ea05..835b0deef9bb1482f986745d7b1aa9917829a5c7 100644 (file)
@@ -2060,10 +2060,7 @@ static void end_bbio_meta_write(struct btrfs_bio *bbio)
        }
 
        buffer_tree_clear_mark(eb, PAGECACHE_TAG_WRITEBACK);
-       clear_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags);
-       smp_mb__after_atomic();
-       wake_up_bit(&eb->bflags, EXTENT_BUFFER_WRITEBACK);
-
+       clear_and_wake_up_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags);
        bio_put(&bbio->bio);
 }
 
@@ -3681,9 +3678,7 @@ void set_extent_buffer_uptodate(struct extent_buffer *eb)
 
 static void clear_extent_buffer_reading(struct extent_buffer *eb)
 {
-       clear_bit(EXTENT_BUFFER_READING, &eb->bflags);
-       smp_mb__after_atomic();
-       wake_up_bit(&eb->bflags, EXTENT_BUFFER_READING);
+       clear_and_wake_up_bit(EXTENT_BUFFER_READING, &eb->bflags);
 }
 
 static void end_bbio_meta_read(struct btrfs_bio *bbio)