diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-02-09 13:44:16 +0300 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-04-07 19:55:55 +0300 |
| commit | 6ee5c986b0ecf3e4be8268e607b62d01676dc115 (patch) | |
| tree | 322237b86a8f63230356871fc7a3becf507ebff3 | |
| parent | e2a7fd22378f6500bcf979edc71e6837271eacfd (diff) | |
| download | linux-6ee5c986b0ecf3e4be8268e607b62d01676dc115.tar.xz | |
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>
| -rw-r--r-- | fs/btrfs/extent_io.c | 6 | ||||
| -rw-r--r-- | fs/btrfs/extent_io.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 5f97a3d2a8d7..942cc95a0375 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -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; } diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 8d05f1a58b7c..d5851cc06f32 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -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); } |
