Skip to content

Commit cf33c1e

Browse files
chenhuacaiaxboe
authored andcommitted
bcache: Fix building error on MIPS
This patch try to fix the building error on MIPS. The reason is MIPS has already defined the PTR macro, which conflicts with the PTR macro in include/uapi/linux/bcache.h. [fixed by mlyle: corrected a line-length issue] Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhc@lemote.com> Reviewed-by: Michael Lyle <mlyle@lyle.org> Signed-off-by: Michael Lyle <mlyle@lyle.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bb22caf commit cf33c1e

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/md/bcache/alloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned reserve,
490490
if (b == -1)
491491
goto err;
492492

493-
k->ptr[i] = PTR(ca->buckets[b].gen,
493+
k->ptr[i] = MAKE_PTR(ca->buckets[b].gen,
494494
bucket_to_sector(c, b),
495495
ca->sb.nr_this_dev);
496496

‎drivers/md/bcache/extents.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ static bool bch_extent_merge(struct btree_keys *bk, struct bkey *l, struct bkey
585585
return false;
586586

587587
for (i = 0; i < KEY_PTRS(l); i++)
588-
if (l->ptr[i] + PTR(0, KEY_SIZE(l), 0) != r->ptr[i] ||
588+
if (l->ptr[i] + MAKE_PTR(0, KEY_SIZE(l), 0) != r->ptr[i] ||
589589
PTR_BUCKET_NR(b->c, l, i) != PTR_BUCKET_NR(b->c, r, i))
590590
return false;
591591

‎drivers/md/bcache/journal.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static void journal_reclaim(struct cache_set *c)
512512
continue;
513513

514514
ja->cur_idx = next;
515-
k->ptr[n++] = PTR(0,
515+
k->ptr[n++] = MAKE_PTR(0,
516516
bucket_to_sector(c, ca->sb.d[ja->cur_idx]),
517517
ca->sb.nr_this_dev);
518518
}

‎include/uapi/linux/bcache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ PTR_FIELD(PTR_GEN, 0, 8)
9191

9292
#define PTR_CHECK_DEV ((1 << PTR_DEV_BITS) - 1)
9393

94-
#define PTR(gen, offset, dev) \
94+
#define MAKE_PTR(gen, offset, dev) \
9595
((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen)
9696

9797
/* Bkey utility code */

0 commit comments

Comments
 (0)