All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix extent_buffer_uptodate() return
@ 2018-02-12 15:34 Anand Jain
  2018-02-12 16:55 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2018-02-12 15:34 UTC (permalink / raw)
  To: linux-btrfs

extent_buffer_uptodate() returns from test_bit() which is of
type bool, so update extent_buffer_uptodate() to it.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/extent_io.c | 2 +-
 fs/btrfs/extent_io.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index bae57b408901..96879c1c1651 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -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);
 }
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 72e5af2965a8..d4ea3a2070ee 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -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,
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix extent_buffer_uptodate() return
  2018-02-12 15:34 [PATCH] btrfs: fix extent_buffer_uptodate() return Anand Jain
@ 2018-02-12 16:55 ` David Sterba
  2018-02-13  4:23   ` Anand Jain
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2018-02-12 16:55 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Mon, Feb 12, 2018 at 11:34:56PM +0800, Anand Jain wrote:
> extent_buffer_uptodate() returns from test_bit() which is of
> type bool, so update extent_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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix extent_buffer_uptodate() return
  2018-02-12 16:55 ` David Sterba
@ 2018-02-13  4:23   ` Anand Jain
  0 siblings, 0 replies; 3+ messages in thread
From: Anand Jain @ 2018-02-13  4:23 UTC (permalink / raw)
  To: dsterba, linux-btrfs



On 02/13/2018 12:55 AM, David Sterba wrote:
> On Mon, Feb 12, 2018 at 11:34:56PM +0800, Anand Jain wrote:
>> extent_buffer_uptodate() returns from test_bit() which is of
>> type bool, so update extent_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.

   Ah the other arch(s) I didn't go that deep, thanks for pointing out.
   Yes pls ignore this patch.

> 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.

  Ok. Will fix that while here.

Thanks, Anand


> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-13  4:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 15:34 [PATCH] btrfs: fix extent_buffer_uptodate() return Anand Jain
2018-02-12 16:55 ` David Sterba
2018-02-13  4:23   ` Anand Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.