btrfs-progs: Move (set/clear_)extent_buffer_uptodate() to extent_io.h.

Unlike kernel, these functions in userland just test/set/clear a member.
So move them to header to avoid extra function call cost.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Qu Wenruo 2015-01-27 11:12:43 +08:00 committed by David Sterba
parent 25db1dd11d
commit 005c470888
2 changed files with 22 additions and 27 deletions

View File

@ -827,29 +827,6 @@ int write_data_to_disk(struct btrfs_fs_info *info, void *buf, u64 offset,
return 0;
}
int set_extent_buffer_uptodate(struct extent_buffer *eb)
{
eb->flags |= EXTENT_UPTODATE;
return 0;
}
int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
struct extent_buffer *eb)
{
eb->flags &= ~EXTENT_UPTODATE;
return 0;
}
int extent_buffer_uptodate(struct extent_buffer *eb)
{
if (!eb || IS_ERR(eb))
return 0;
if (eb->flags & EXTENT_UPTODATE)
return 1;
return 0;
}
int set_extent_buffer_dirty(struct extent_buffer *eb)
{
struct extent_io_tree *tree = eb->tree;

View File

@ -100,10 +100,28 @@ int set_extent_dirty(struct extent_io_tree *tree, u64 start,
u64 end, gfp_t mask);
int clear_extent_dirty(struct extent_io_tree *tree, u64 start,
u64 end, gfp_t mask);
int extent_buffer_uptodate(struct extent_buffer *eb);
int set_extent_buffer_uptodate(struct extent_buffer *eb);
int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
struct extent_buffer *eb);
static inline int set_extent_buffer_uptodate(struct extent_buffer *eb)
{
eb->flags |= EXTENT_UPTODATE;
return 0;
}
static inline int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
struct extent_buffer *eb)
{
eb->flags &= ~EXTENT_UPTODATE;
return 0;
}
static inline int extent_buffer_uptodate(struct extent_buffer *eb)
{
if (!eb || IS_ERR(eb))
return 0;
if (eb->flags & EXTENT_UPTODATE)
return 1;
return 0;
}
int set_state_private(struct extent_io_tree *tree, u64 start, u64 xprivate);
int get_state_private(struct extent_io_tree *tree, u64 start, u64 *xprivate);
struct extent_buffer *find_extent_buffer(struct extent_io_tree *tree,