]> git.hungrycats.org Git - linux/commitdiff
bcache: Fix building error on MIPS
authorHuacai Chen <chenhc@lemote.com>
Fri, 24 Nov 2017 23:14:25 +0000 (15:14 -0800)
committerSasha Levin <alexander.levin@verizon.com>
Fri, 8 Dec 2017 23:01:16 +0000 (18:01 -0500)
[ Upstream commit cf33c1ee5254c6a430bc1538232b49c3ea13e613 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/md/bcache/alloc.c
drivers/md/bcache/extents.c
drivers/md/bcache/journal.c
include/uapi/linux/bcache.h

index ea47980949ef6ab6222cfbe13863670b47b06869..4d46f2ce606f96986c818d2d516408dee6e0c2c4 100644 (file)
@@ -479,7 +479,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned reserve,
                if (b == -1)
                        goto err;
 
-               k->ptr[i] = PTR(ca->buckets[b].gen,
+               k->ptr[i] = MAKE_PTR(ca->buckets[b].gen,
                                bucket_to_sector(c, b),
                                ca->sb.nr_this_dev);
 
index 243de0bf15cdbf359965dff55cac4762b804362f..4bf15182c4da21c31cc8a4751a027ac436e54b20 100644 (file)
@@ -584,7 +584,7 @@ static bool bch_extent_merge(struct btree_keys *bk, struct bkey *l, struct bkey
                return false;
 
        for (i = 0; i < KEY_PTRS(l); i++)
-               if (l->ptr[i] + PTR(0, KEY_SIZE(l), 0) != r->ptr[i] ||
+               if (l->ptr[i] + MAKE_PTR(0, KEY_SIZE(l), 0) != r->ptr[i] ||
                    PTR_BUCKET_NR(b->c, l, i) != PTR_BUCKET_NR(b->c, r, i))
                        return false;
 
index fe080ad0e55841e5c95bfcb3dcf3a0f1a703b76c..6fb47a2a3d9dcca58c6f132fb52a388a44da7362 100644 (file)
@@ -508,7 +508,7 @@ static void journal_reclaim(struct cache_set *c)
                        continue;
 
                ja->cur_idx = next;
-               k->ptr[n++] = PTR(0,
+               k->ptr[n++] = MAKE_PTR(0,
                                  bucket_to_sector(c, ca->sb.d[ja->cur_idx]),
                                  ca->sb.nr_this_dev);
        }
index 22b6ad31c706dae59544286faea5808d7b303342..8562b1cb776b7d69ae6c5c46d0867302a55f658f 100644 (file)
@@ -90,7 +90,7 @@ PTR_FIELD(PTR_GEN,                    0,  8)
 
 #define PTR_CHECK_DEV                  ((1 << PTR_DEV_BITS) - 1)
 
-#define PTR(gen, offset, dev)                                          \
+#define MAKE_PTR(gen, offset, dev)                                     \
        ((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen)
 
 /* Bkey utility code */