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:
parent
25db1dd11d
commit
005c470888
23
extent_io.c
23
extent_io.c
|
@ -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;
|
||||
|
|
26
extent_io.h
26
extent_io.h
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue