summaryrefslogtreecommitdiff
path: root/extent-cache.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 14:32:01 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 14:32:01 +0100
commit3b9cf4c8cda0818e4d3f9892ece9f7d99de13b03 (patch)
tree59446f505b5bb3b31b1b3bb81af997dda68407c2 /extent-cache.c
parentf22f0302575d3a167ee550470c922de82e34342b (diff)
Diffstat (limited to 'extent-cache.c')
-rw-r--r--extent-cache.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/extent-cache.c b/extent-cache.c
index 38bed8b..f458de2 100644
--- a/extent-cache.c
+++ b/extent-cache.c
@@ -93,24 +93,22 @@ void cache_tree_init(struct cache_tree *tree)
tree->root = RB_ROOT;
}
-static struct cache_extent *
-alloc_cache_extent(u64 objectid, u64 start, u64 size)
+static struct cache_extent *alloc_cache_extent(u64 start, u64 size)
{
struct cache_extent *pe = malloc(sizeof(*pe));
if (!pe)
return pe;
- pe->objectid = objectid;
+ pe->objectid = 0;
pe->start = start;
pe->size = size;
return pe;
}
-static int __add_cache_extent(struct cache_tree *tree,
- u64 objectid, u64 start, u64 size)
+int add_cache_extent(struct cache_tree *tree, u64 start, u64 size)
{
- struct cache_extent *pe = alloc_cache_extent(objectid, start, size);
+ struct cache_extent *pe = alloc_cache_extent(start, size);
int ret;
if (!pe) {
@@ -125,17 +123,6 @@ static int __add_cache_extent(struct cache_tree *tree,
return ret;
}
-int add_cache_extent(struct cache_tree *tree, u64 start, u64 size)
-{
- return __add_cache_extent(tree, 0, start, size);
-}
-
-int add_cache_extent2(struct cache_tree *tree,
- u64 objectid, u64 start, u64 size)
-{
- return __add_cache_extent(tree, objectid, start, size);
-}
-
int insert_cache_extent(struct cache_tree *tree, struct cache_extent *pe)
{
return rb_insert(&tree->root, &pe->rb_node, cache_tree_comp_nodes);