Skip to content

Commit

Permalink
bcache: remove macro nr_to_fifo_front()
Browse files Browse the repository at this point in the history
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: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Coly Li authored and Jens Axboe committed Feb 13, 2020
1 parent 309cc71 commit 4ec31cb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/md/bcache/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ int bch_journal_replay(struct cache_set *s, struct list_head *list)

/* Journalling */

#define nr_to_fifo_front(p, front_p, mask) (((p) - (front_p)) & (mask))

static void btree_flush_write(struct cache_set *c)
{
struct btree *b, *t, *btree_nodes[BTREE_FLUSH_NR];
Expand Down Expand Up @@ -510,9 +508,8 @@ static void btree_flush_write(struct cache_set *c)
* journal entry can be reclaimed). These selected nodes
* will be ignored and skipped in the folowing for-loop.
*/
if (nr_to_fifo_front(btree_current_write(b)->journal,
fifo_front_p,
mask) != 0) {
if (((btree_current_write(b)->journal - fifo_front_p) &
mask) != 0) {
mutex_unlock(&b->write_lock);
continue;
}
Expand Down

0 comments on commit 4ec31cb

Please sign in to comment.