Commit 4ec31cb6 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: remove macro nr_to_fifo_front()

Macro nr_to_fifo_front() is only used once in btree_flush_write(),
it is unncessary indeed. This patch removes this macro and does
calculation directly in place.
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 309cc719
...@@ -417,8 +417,6 @@ int bch_journal_replay(struct cache_set *s, struct list_head *list) ...@@ -417,8 +417,6 @@ int bch_journal_replay(struct cache_set *s, struct list_head *list)
/* Journalling */ /* Journalling */
#define nr_to_fifo_front(p, front_p, mask) (((p) - (front_p)) & (mask))
static void btree_flush_write(struct cache_set *c) static void btree_flush_write(struct cache_set *c)
{ {
struct btree *b, *t, *btree_nodes[BTREE_FLUSH_NR]; struct btree *b, *t, *btree_nodes[BTREE_FLUSH_NR];
...@@ -510,9 +508,8 @@ static void btree_flush_write(struct cache_set *c) ...@@ -510,9 +508,8 @@ static void btree_flush_write(struct cache_set *c)
* journal entry can be reclaimed). These selected nodes * journal entry can be reclaimed). These selected nodes
* will be ignored and skipped in the folowing for-loop. * will be ignored and skipped in the folowing for-loop.
*/ */
if (nr_to_fifo_front(btree_current_write(b)->journal, if (((btree_current_write(b)->journal - fifo_front_p) &
fifo_front_p, mask) != 0) {
mask) != 0) {
mutex_unlock(&b->write_lock); mutex_unlock(&b->write_lock);
continue; continue;
} }
......
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