From: Coly Li <colyli@suse.de>
To: axboe@kernel.dk
Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
Coly Li <colyli@suse.de>, Christoph Hellwig <hch@infradead.org>
Subject: [PATCH 2/7] bcache: add bcache_ prefix to btree_root() and btree() macros
Date: Sun, 22 Mar 2020 14:03:00 +0800 [thread overview]
Message-ID: <20200322060305.70637-3-colyli@suse.de> (raw)
In-Reply-To: <20200322060305.70637-1-colyli@suse.de>
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 porduct 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>
---
drivers/md/bcache/btree.c | 15 ++++++++-------
drivers/md/bcache/btree.h | 4 ++--
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 99cb201809af..faf152524a16 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.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 */
do {
- ret = btree_root(gc_root, c, &op, &writes, &stats);
+ ret = bcache_btree_root(gc_root, c, &op, &writes, &stats);
closure_sync(&writes);
cond_resched();
@@ -1888,7 +1888,7 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op)
}
if (p)
- ret = btree(check_recurse, p, b, op);
+ ret = bcache_btree(check_recurse, p, b, op);
p = k;
} while (p && !ret);
@@ -1903,7 +1903,7 @@ int bch_btree_check(struct cache_set *c)
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)
@@ -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,
bch_ptr_bad))) {
- ret = btree(map_nodes_recurse, k, b,
+ ret = bcache_btree(map_nodes_recurse, k, b,
op, from, fn, flags);
from = NULL;
@@ -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,
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,
@@ -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))) {
ret = !b->level
? 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;
if (ret != MAP_CONTINUE)
@@ -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,
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 */
diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h
index f37153db3f6c..19e30266070a 100644
--- a/drivers/md/bcache/btree.h
+++ b/drivers/md/bcache/btree.h
@@ -309,7 +309,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
* @b: parent btree node
* @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; \
bool _w = l <= (op)->lock; \
@@ -329,7 +329,7 @@ static inline void force_wake_up_gc(struct cache_set *c)
* @c: cache set
* @op: pointer to struct btree_op
*/
-#define btree_root(fn, c, op, ...) \
+#define bcache_btree_root(fn, c, op, ...) \
({ \
int _r = -EINTR; \
do { \
--
2.25.0
next prev parent reply other threads:[~2020-03-22 6:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 6:02 [PATCH 0/7] bcache patches for Linux v5.7-rc1 Coly Li
2020-03-22 6:02 ` [PATCH 1/7] bcache: move macro btree() and btree_root() into btree.h Coly Li
2020-03-23 7:05 ` Hannes Reinecke
2020-03-22 6:03 ` Coly Li [this message]
2020-03-23 7:06 ` [PATCH 2/7] bcache: add bcache_ prefix to btree_root() and btree() macros Hannes Reinecke
2020-03-22 6:03 ` [PATCH 3/7] bcache: make bch_btree_check() to be multithreaded Coly Li
2020-03-23 7:00 ` Hannes Reinecke
2020-03-22 6:03 ` [PATCH 4/7] bcache: make bch_sectors_dirty_init() " Coly Li
2020-03-23 7:03 ` Hannes Reinecke
2020-03-23 9:41 ` Coly Li
2020-03-22 6:03 ` [PATCH 5/7] bcache: Use scnprintf() for avoiding potential buffer overflow Coly Li
2020-03-23 7:04 ` Hannes Reinecke
2020-03-23 8:15 ` Takashi Iwai
2020-03-22 6:03 ` [PATCH 6/7] bcache: optimize barrier usage for Rmw atomic bitops Coly Li
2020-03-23 7:08 ` Hannes Reinecke
2020-03-23 8:45 ` Coly Li
2020-03-22 6:03 ` [PATCH 7/7] bcache: optimize barrier usage for atomic operations Coly Li
2020-03-23 7:09 ` Hannes Reinecke
2020-03-22 16:07 ` [PATCH 0/7] bcache patches for Linux v5.7-rc1 Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200322060305.70637-3-colyli@suse.de \
--to=colyli@suse.de \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).