From: Filipe Manana Date: Mon, 9 Feb 2026 10:44:16 +0000 (+0000) Subject: btrfs: use the helper extent_buffer_uptodate() everywhere X-Git-Tag: v7.1-rc1~231^2~93 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6ee5c986b0ecf3e4be8268e607b62d01676dc115;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Filipe Manana Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 5f97a3d2a8d72..942cc95a0375c 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 8d05f1a58b7c3..d5851cc06f322 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); }