btrfs: fix extent_buffer_uptodate() return
PATCH 1/1 btrfs: fix extent_buffer_uptodate() return
extent_buffer_uptodate() returns from test_bit() which is of type bool, so update extent_buffer_uptodate() to it.
--- fs/btrfs/extent_io.c | 2 +- fs/btrfs/extent_io.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/extent_io.c +1 -1
@@ -5229,7 +5229,7 @@ void set_extent_buffer_uptodate(struct extent_buffer *eb) } } -int extent_buffer_uptodate (struct extent_buffer *eb) +bool extent_buffer_uptodate (struct extent_buffer *eb) {return test_bit (EXTENT_BUFFER_UPTODATE , &eb->bflags); }
fs/btrfs/extent_io.h +1 -1
@@ -489,7 +489,7 @@ void clear_extent_buffer_dirty(struct extent_buffer *eb);int set_extent_buffer_dirty (struct extent_buffer *eb);void set_extent_buffer_uptodate (struct extent_buffer *eb);void clear_extent_buffer_uptodate (struct extent_buffer *eb); -int extent_buffer_uptodate (struct extent_buffer *eb); +bool extent_buffer_uptodate (struct extent_buffer *eb);int extent_buffer_under_io (struct extent_buffer *eb); int map_private_extent_buffer(const struct extent_buffer *eb, unsigned long offset, unsigned long min_len,
Signature · 1 line
2.15.0
Quoted 2 lines · Anand Jain
extent_buffer_uptodate()returns fromtest_bit()which is of type bool, so updateextent_buffer_uptodate()to it.
The return value of test_bit differes by architecture, there are several that return int. You probably refer to x86 that uses some trickery to optimize for constants and that returns bool. While we can add more int/bool, I don't think it's wrong to have int here so I don't see what this patch fixes.
In this particular case, extent_buffer_uptodate is a trivial wrapper around test_bit so it would be better to make it a static inline. This would remove the call indirection and reduce size of the code.
Quoted 9 lines · David Sterba
Quoted 2 lines · Anand Jain
extent_buffer_uptodate()returns fromtest_bit()which is of type bool, so updateextent_buffer_uptodate()to it.The return value of
test_bitdifferes by architecture, there are several that return int. You probably refer to x86 that uses some trickery to optimize for constants and that returns bool. While we can add more int/bool, I don't think it's wrong to have int here so I don't see what this patch fixes.
Ah the other arch(s) I didn't go that deep, thanks for pointing out. Yes pls ignore this patch.
Quoted 3 lines
In this particular case,
extent_buffer_uptodateis a trivial wrapper aroundtest_bitso it would be better to make it a static inline. This would remove the call indirection and reduce size of the code.
Ok. Will fix that while here.
Thanks, Anand
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html