Skip to content

Commit cdc6bf9

Browse files
committed
btrfs: use clear_and_wake_up_bit() where open coded
There are two cases open coding the clear and wake up pattern, we can use the helper. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent cd526e5 commit cdc6bf9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/btrfs/extent_io.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,10 +2060,7 @@ static void end_bbio_meta_write(struct btrfs_bio *bbio)
20602060
}
20612061

20622062
buffer_tree_clear_mark(eb, PAGECACHE_TAG_WRITEBACK);
2063-
clear_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags);
2064-
smp_mb__after_atomic();
2065-
wake_up_bit(&eb->bflags, EXTENT_BUFFER_WRITEBACK);
2066-
2063+
clear_and_wake_up_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags);
20672064
bio_put(&bbio->bio);
20682065
}
20692066

@@ -3682,9 +3679,7 @@ void set_extent_buffer_uptodate(struct extent_buffer *eb)
36823679

36833680
static void clear_extent_buffer_reading(struct extent_buffer *eb)
36843681
{
3685-
clear_bit(EXTENT_BUFFER_READING, &eb->bflags);
3686-
smp_mb__after_atomic();
3687-
wake_up_bit(&eb->bflags, EXTENT_BUFFER_READING);
3682+
clear_and_wake_up_bit(EXTENT_BUFFER_READING, &eb->bflags);
36883683
}
36893684

36903685
static void end_bbio_meta_read(struct btrfs_bio *bbio)

0 commit comments

Comments
 (0)