Skip to content

Commit 4ec31cb

Browse files
Coly Liaxboe
authored andcommitted
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: Coly Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 309cc71 commit 4ec31cb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/md/bcache/journal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,6 @@ int bch_journal_replay(struct cache_set *s, struct list_head *list)
417417

418418
/* Journalling */
419419

420-
#define nr_to_fifo_front(p, front_p, mask) (((p) - (front_p)) & (mask))
421-
422420
static void btree_flush_write(struct cache_set *c)
423421
{
424422
struct btree *b, *t, *btree_nodes[BTREE_FLUSH_NR];
@@ -510,9 +508,8 @@ static void btree_flush_write(struct cache_set *c)
510508
* journal entry can be reclaimed). These selected nodes
511509
* will be ignored and skipped in the folowing for-loop.
512510
*/
513-
if (nr_to_fifo_front(btree_current_write(b)->journal,
514-
fifo_front_p,
515-
mask) != 0) {
511+
if (((btree_current_write(b)->journal - fifo_front_p) &
512+
mask) != 0) {
516513
mutex_unlock(&b->write_lock);
517514
continue;
518515
}

0 commit comments

Comments
 (0)