aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.h
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-24 23:06:40 -0700
committerKent Overstreet <kmo@daterainc.com>2013-11-10 21:56:35 -0800
commitd5cc66e95744065f96024add4bf7d7e019be54ac (patch)
tree6d134aaa14c6420f4193734dbe49a4ee32d2bb06 /drivers/md/bcache/btree.h
parentbcache: Don't bother with bucket refcount for btree node allocations (diff)
downloadlinux-dev-d5cc66e95744065f96024add4bf7d7e019be54ac.tar.xz
linux-dev-d5cc66e95744065f96024add4bf7d7e019be54ac.zip
bcache: bch_(btree|extent)_ptr_invalid()
Trying to treat btree pointers and leaf node pointers the same way was a mistake - going to start being more explicit about the type of key/pointer we're dealing with. This is the first part of that refactoring; this patch shouldn't change any actual behaviour. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.h')
-rw-r--r--drivers/md/bcache/btree.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
index d4b705eeec24..e11bb8571d24 100644
--- a/drivers/md/bcache/btree.h
+++ b/drivers/md/bcache/btree.h
@@ -204,11 +204,6 @@ static inline void set_gc_sectors(struct cache_set *c)
atomic_set(&c->sectors_to_gc, c->sb.bucket_size * c->nbuckets / 8);
}
-static inline bool bch_ptr_invalid(struct btree *b, const struct bkey *k)
-{
- return __bch_ptr_invalid(b->c, b->level, k);
-}
-
static inline struct bkey *bch_btree_iter_init(struct btree *b,
struct btree_iter *iter,
struct bkey *search)
@@ -216,6 +211,14 @@ static inline struct bkey *bch_btree_iter_init(struct btree *b,
return __bch_btree_iter_init(b, iter, search, b->sets);
}
+static inline bool bch_ptr_invalid(struct btree *b, const struct bkey *k)
+{
+ if (b->level)
+ return bch_btree_ptr_invalid(b->c, k);
+ else
+ return bch_extent_ptr_invalid(b->c, k);
+}
+
void bkey_put(struct cache_set *c, struct bkey *k);
/* Looping macros */