path: root/extent-cache.c
diff options
authorYan Zheng <>2008-01-04 10:36:26 -0500
committerDavid Woodhouse <>2008-01-04 10:36:26 -0500
commit088f78aeaadac6cc877975c6974731968c0093d1 (patch)
treeafa4c8a81c49b7bc5b8e24eae9c477488de7426f /extent-cache.c
parent7e03dadf20f7f2f3bfac9e83cf71d4ecce60782e (diff)
Port extent buffer to btrfs-progs
This patch ports extent buffer to btrfs-progs. extent_map.c contains a simplified extent map tree and functions that manipulate/manage extent buffer. extent state related codes are based on corresponding codes in kernel module, codes that manage extent buffer are from disk-io.c.
Diffstat (limited to 'extent-cache.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/extent-cache.c b/extent-cache.c
index cfc6b639..4e6d1b29 100644
--- a/extent-cache.c
+++ b/extent-cache.c
@@ -143,6 +143,15 @@ struct cache_extent *find_first_cache_extent(struct cache_tree *tree,
return entry;
+struct cache_extent *prev_cache_extent(struct cache_extent *pe)
+ struct rb_node *node = rb_prev(&pe->rb_node);
+ if (!node)
+ return NULL;
+ return rb_entry(node, struct cache_extent, rb_node);
struct cache_extent *next_cache_extent(struct cache_extent *pe)
struct rb_node *node = rb_next(&pe->rb_node);