summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.h
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-18 08:49:49 +0100
committerKent Overstreet <kmo@daterainc.com>2014-01-08 22:05:12 +0100
commitee811287c9f241641899788cbfc9d70ed96ba3a5 (patch)
tree91995b415b61e17bc5cc0796e2a7d933c1ca4e60 /drivers/md/bcache/btree.h
parentbcache: Add struct bset_sort_state (diff)
downloadlinux-ee811287c9f241641899788cbfc9d70ed96ba3a5.tar.xz
linux-ee811287c9f241641899788cbfc9d70ed96ba3a5.zip
bcache: Rename/shuffle various code around
More work to disentangle bset.c from the rest of the code: Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.h')
-rw-r--r--drivers/md/bcache/btree.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
index 2a5a8481f25e..b3541173ccf2 100644
--- a/drivers/md/bcache/btree.h
+++ b/drivers/md/bcache/btree.h
@@ -180,9 +180,9 @@ static inline struct btree_write *btree_prev_write(struct btree *b)
return b->writes + (btree_node_write_idx(b) ^ 1);
}
-static inline unsigned bset_offset(struct btree *b, struct bset *i)
+static inline struct bset_tree *bset_tree_last(struct btree *b)
{
- return (((size_t) i) - ((size_t) b->sets->data)) >> 9;
+ return b->sets + b->nsets;
}
static inline struct bset *btree_bset_first(struct btree *b)
@@ -190,6 +190,11 @@ static inline struct bset *btree_bset_first(struct btree *b)
return b->sets->data;
}
+static inline struct bset *btree_bset_last(struct btree *b)
+{
+ return bset_tree_last(b)->data;
+}
+
static inline unsigned bset_byte_offset(struct btree *b, struct bset *i)
{
return ((size_t) i) - ((size_t) b->sets->data);