Skip to content

Commit feac1a7

Browse files
Coly Liaxboe
authored andcommitted
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: Christoph Hellwig <hch@infradead.org> Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 253a99d commit feac1a7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

drivers/md/bcache/btree.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ static void bch_btree_gc(struct cache_set *c)
17901790

17911791
/* if CACHE_SET_IO_DISABLE set, gc thread should stop too */
17921792
do {
1793-
ret = btree_root(gc_root, c, &op, &writes, &stats);
1793+
ret = bcache_btree_root(gc_root, c, &op, &writes, &stats);
17941794
closure_sync(&writes);
17951795
cond_resched();
17961796

@@ -1888,7 +1888,7 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op)
18881888
}
18891889

18901890
if (p)
1891-
ret = btree(check_recurse, p, b, op);
1891+
ret = bcache_btree(check_recurse, p, b, op);
18921892

18931893
p = k;
18941894
} while (p && !ret);
@@ -1903,7 +1903,7 @@ int bch_btree_check(struct cache_set *c)
19031903

19041904
bch_btree_op_init(&op, SHRT_MAX);
19051905

1906-
return btree_root(check_recurse, c, &op);
1906+
return bcache_btree_root(check_recurse, c, &op);
19071907
}
19081908

19091909
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,
23432343

23442344
while ((k = bch_btree_iter_next_filter(&iter, &b->keys,
23452345
bch_ptr_bad))) {
2346-
ret = btree(map_nodes_recurse, k, b,
2346+
ret = bcache_btree(map_nodes_recurse, k, b,
23472347
op, from, fn, flags);
23482348
from = NULL;
23492349

@@ -2361,7 +2361,7 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op,
23612361
int __bch_btree_map_nodes(struct btree_op *op, struct cache_set *c,
23622362
struct bkey *from, btree_map_nodes_fn *fn, int flags)
23632363
{
2364-
return btree_root(map_nodes_recurse, c, op, from, fn, flags);
2364+
return bcache_btree_root(map_nodes_recurse, c, op, from, fn, flags);
23652365
}
23662366

23672367
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,
23772377
while ((k = bch_btree_iter_next_filter(&iter, &b->keys, bch_ptr_bad))) {
23782378
ret = !b->level
23792379
? fn(op, b, k)
2380-
: btree(map_keys_recurse, k, b, op, from, fn, flags);
2380+
: bcache_btree(map_keys_recurse, k,
2381+
b, op, from, fn, flags);
23812382
from = NULL;
23822383

23832384
if (ret != MAP_CONTINUE)
@@ -2394,7 +2395,7 @@ int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op,
23942395
int bch_btree_map_keys(struct btree_op *op, struct cache_set *c,
23952396
struct bkey *from, btree_map_keys_fn *fn, int flags)
23962397
{
2397-
return btree_root(map_keys_recurse, c, op, from, fn, flags);
2398+
return bcache_btree_root(map_keys_recurse, c, op, from, fn, flags);
23982399
}
23992400

24002401
/* Keybuf code */

drivers/md/bcache/btree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
309309
* @b: parent btree node
310310
* @op: pointer to struct btree_op
311311
*/
312-
#define btree(fn, key, b, op, ...) \
312+
#define bcache_btree(fn, key, b, op, ...) \
313313
({ \
314314
int _r, l = (b)->level - 1; \
315315
bool _w = l <= (op)->lock; \
@@ -329,7 +329,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
329329
* @c: cache set
330330
* @op: pointer to struct btree_op
331331
*/
332-
#define btree_root(fn, c, op, ...) \
332+
#define bcache_btree_root(fn, c, op, ...) \
333333
({ \
334334
int _r = -EINTR; \
335335
do { \

0 commit comments

Comments
 (0)