Commit feac1a70 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: add bcache_ prefix to btree_root() and btree() macros

This patch changes macro btree_root() and btree() to bcache_btree_root()
and bcache_btree(), to avoid potential generic name clash in future.

NOTE: for product kernel maintainers, this patch can be skipped if
you feel the rename stuffs introduce inconvenince to patch backport.
Suggested-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 253a99d9
...@@ -1790,7 +1790,7 @@ static void bch_btree_gc(struct cache_set *c) ...@@ -1790,7 +1790,7 @@ static void bch_btree_gc(struct cache_set *c)
/* if CACHE_SET_IO_DISABLE set, gc thread should stop too */ /* if CACHE_SET_IO_DISABLE set, gc thread should stop too */
do { do {
ret = btree_root(gc_root, c, &op, &writes, &stats); ret = bcache_btree_root(gc_root, c, &op, &writes, &stats);
closure_sync(&writes); closure_sync(&writes);
cond_resched(); cond_resched();
...@@ -1888,7 +1888,7 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op) ...@@ -1888,7 +1888,7 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op)
} }
if (p) if (p)
ret = btree(check_recurse, p, b, op); ret = bcache_btree(check_recurse, p, b, op);
p = k; p = k;
} while (p && !ret); } while (p && !ret);
...@@ -1903,7 +1903,7 @@ int bch_btree_check(struct cache_set *c) ...@@ -1903,7 +1903,7 @@ int bch_btree_check(struct cache_set *c)
bch_btree_op_init(&op, SHRT_MAX); bch_btree_op_init(&op, SHRT_MAX);
return btree_root(check_recurse, c, &op); return bcache_btree_root(check_recurse, c, &op);
} }
void bch_initial_gc_finish(struct cache_set *c) void bch_initial_gc_finish(struct cache_set *c)
...@@ -2343,7 +2343,7 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op, ...@@ -2343,7 +2343,7 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op,
while ((k = bch_btree_iter_next_filter(&iter, &b->keys, while ((k = bch_btree_iter_next_filter(&iter, &b->keys,
bch_ptr_bad))) { bch_ptr_bad))) {
ret = btree(map_nodes_recurse, k, b, ret = bcache_btree(map_nodes_recurse, k, b,
op, from, fn, flags); op, from, fn, flags);
from = NULL; from = NULL;
...@@ -2361,7 +2361,7 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op, ...@@ -2361,7 +2361,7 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op,
int __bch_btree_map_nodes(struct btree_op *op, struct cache_set *c, int __bch_btree_map_nodes(struct btree_op *op, struct cache_set *c,
struct bkey *from, btree_map_nodes_fn *fn, int flags) struct bkey *from, btree_map_nodes_fn *fn, int flags)
{ {
return btree_root(map_nodes_recurse, c, op, from, fn, flags); return bcache_btree_root(map_nodes_recurse, c, op, from, fn, flags);
} }
int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op, int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op,
...@@ -2377,7 +2377,8 @@ int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op, ...@@ -2377,7 +2377,8 @@ int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op,
while ((k = bch_btree_iter_next_filter(&iter, &b->keys, bch_ptr_bad))) { while ((k = bch_btree_iter_next_filter(&iter, &b->keys, bch_ptr_bad))) {
ret = !b->level ret = !b->level
? fn(op, b, k) ? fn(op, b, k)
: btree(map_keys_recurse, k, b, op, from, fn, flags); : bcache_btree(map_keys_recurse, k,
b, op, from, fn, flags);
from = NULL; from = NULL;
if (ret != MAP_CONTINUE) if (ret != MAP_CONTINUE)
...@@ -2394,7 +2395,7 @@ int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op, ...@@ -2394,7 +2395,7 @@ int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op,
int bch_btree_map_keys(struct btree_op *op, struct cache_set *c, int bch_btree_map_keys(struct btree_op *op, struct cache_set *c,
struct bkey *from, btree_map_keys_fn *fn, int flags) struct bkey *from, btree_map_keys_fn *fn, int flags)
{ {
return btree_root(map_keys_recurse, c, op, from, fn, flags); return bcache_btree_root(map_keys_recurse, c, op, from, fn, flags);
} }
/* Keybuf code */ /* Keybuf code */
......
...@@ -309,7 +309,7 @@ static inline void force_wake_up_gc(struct cache_set *c) ...@@ -309,7 +309,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
* @b: parent btree node * @b: parent btree node
* @op: pointer to struct btree_op * @op: pointer to struct btree_op
*/ */
#define btree(fn, key, b, op, ...) \ #define bcache_btree(fn, key, b, op, ...) \
({ \ ({ \
int _r, l = (b)->level - 1; \ int _r, l = (b)->level - 1; \
bool _w = l <= (op)->lock; \ bool _w = l <= (op)->lock; \
...@@ -329,7 +329,7 @@ static inline void force_wake_up_gc(struct cache_set *c) ...@@ -329,7 +329,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
* @c: cache set * @c: cache set
* @op: pointer to struct btree_op * @op: pointer to struct btree_op
*/ */
#define btree_root(fn, c, op, ...) \ #define bcache_btree_root(fn, c, op, ...) \
({ \ ({ \
int _r = -EINTR; \ int _r = -EINTR; \
do { \ do { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment