diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-25 10:06:40 +0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 09:56:35 +0400 |
commit | d5cc66e95744065f96024add4bf7d7e019be54ac (patch) | |
tree | 6d134aaa14c6420f4193734dbe49a4ee32d2bb06 /drivers/md/bcache/btree.h | |
parent | 3a3b6a4e075188342b58d4b6560f5540af64cac0 (diff) | |
download | linux-d5cc66e95744065f96024add4bf7d7e019be54ac.tar.xz |
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.h | 13 |
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 */ |