aboutsummaryrefslogtreecommitdiffstats
path: root/extent_io.h
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-01-27 11:12:43 +0800
committerDavid Sterba <dsterba@suse.cz>2015-02-27 17:44:11 +0100
commit005c470888ac2c04ba9263845d0ed3b19e9e6c69 (patch)
treebaa60a70d0bbe50b175498201a85e1a6889ca75e /extent_io.h
parent25db1dd11de2f255894896d691121795c60ee2bb (diff)
downloadbtrfs-progs-005c470888ac2c04ba9263845d0ed3b19e9e6c69.tar.gz
btrfs-progs-005c470888ac2c04ba9263845d0ed3b19e9e6c69.tar.xz
btrfs-progs-005c470888ac2c04ba9263845d0ed3b19e9e6c69.zip
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>
Diffstat (limited to 'extent_io.h')
-rw-r--r--extent_io.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/extent_io.h b/extent_io.h
index 3ded493..27c4b69 100644
--- a/extent_io.h
+++ b/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,