mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
btrfs: use the helper extent_buffer_uptodate() everywhere
Instead of open coding testing the uptodate bit on the extent buffer's flags, use the existing helper extent_buffer_uptodate() (which is even shorter to type). Also change the helper's return value from int to bool, since we always use it in a boolean context. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e2a7fd2237
commit
6ee5c986b0
|
|
@ -3871,7 +3871,7 @@ int read_extent_buffer_pages_nowait(struct extent_buffer *eb, int mirror_num,
|
|||
struct btrfs_fs_info *fs_info = eb->fs_info;
|
||||
struct btrfs_bio *bbio;
|
||||
|
||||
if (test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))
|
||||
if (extent_buffer_uptodate(eb))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
|
@ -3892,7 +3892,7 @@ int read_extent_buffer_pages_nowait(struct extent_buffer *eb, int mirror_num,
|
|||
* started and finished reading the same eb. In this case, UPTODATE
|
||||
* will now be set, and we shouldn't read it in again.
|
||||
*/
|
||||
if (unlikely(test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))) {
|
||||
if (unlikely(extent_buffer_uptodate(eb))) {
|
||||
clear_extent_buffer_reading(eb);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3929,7 +3929,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int mirror_num,
|
|||
return ret;
|
||||
|
||||
wait_on_bit_io(&eb->bflags, EXTENT_BUFFER_READING, TASK_UNINTERRUPTIBLE);
|
||||
if (unlikely(!test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags)))
|
||||
if (unlikely(!extent_buffer_uptodate(eb)))
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ static inline int __pure num_extent_folios(const struct extent_buffer *eb)
|
|||
return num_extent_pages(eb);
|
||||
}
|
||||
|
||||
static inline int extent_buffer_uptodate(const struct extent_buffer *eb)
|
||||
static inline bool extent_buffer_uptodate(const struct extent_buffer *eb)
|
||||
{
|
||||
return test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user