From patchwork Fri Nov 24 23:14:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10074669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C476E60383 for ; Fri, 24 Nov 2017 23:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B95932A210 for ; Fri, 24 Nov 2017 23:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE4C42A213; Fri, 24 Nov 2017 23:14:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA8C2A210 for ; Fri, 24 Nov 2017 23:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753843AbdKXXOq (ORCPT ); Fri, 24 Nov 2017 18:14:46 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44504 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753840AbdKXXOp (ORCPT ); Fri, 24 Nov 2017 18:14:45 -0500 Received: by mail-pl0-f68.google.com with SMTP id v15so5115254plk.11 for ; Fri, 24 Nov 2017 15:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyle-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CIF4dRo5JlcQNxpcwHbB8KWSB8D3Eq5e0ND70tl7434=; b=yvs9BiSe4NjD248U/t6jKAJmyArI6U06Of2ySJ5lUmKbVDyXK8FOKaEOI4sc2Cdfcx pzIb/jzpUNbTV7+51TaPyZEsOwrf0nli5Kx+NyOVNlxQUAXQM9iByq15Idp/8gil1oLn C9lbtDf6egI9ot9czVvTNCG95LPgsbLp34ymuxTSqSrAJmm31fNiWKc11zMN3iGQvBbC uMFlLYgDMcIWtY6zOsqyck2s6rtHR5e0SaYGxGZFN6zfbJ18Cc/vklO/15SW+qO7gzrz wcdvQwizB5owwkxRHKPFt7f6JYGVqzW973bQJFEt8ncqwCYjidU1Ft2iz+S/6sA+WXCB a3bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CIF4dRo5JlcQNxpcwHbB8KWSB8D3Eq5e0ND70tl7434=; b=gywqlo7HNcrb/m1vBwh0uECSYxTVIpKWxjyXUwV+6WwxiB70m11kx/ZiY6HCqvviVb tH8b19YyqbHX+LfOcQ0OqPXfNGStXuXd8NH2LUxXe9kHytGpKP09tgznBj41a8l/QGNb sD5eJWPkt2utxJMuezxlrG5WJ/xmp96MD3NRVR9YjGKOa4yj2ysi9Ad8pdiRx0JRkzAM bfuIBVnXIpuFHjXMXRR878Aa8nJlGfm9H7EUFcPLh4I5YxJMb8ZtF02q8KGds6k/uoqK UZ6KhAY9wViuaRANXuGac9uJEc88xFQ/fPXNXnx7qZdpzd2Czv67hpvS/6e5BZPzACQC NEyQ== X-Gm-Message-State: AJaThX7mQGpaFpuQqJBUz8WDyz+/aK/Q5Xml+isbxV6JiZPZYN/6d+v6 OVODJJtctggfFjkeyuhMT8Yjrg== X-Google-Smtp-Source: AGs4zMYqBndhllotNOp2VuGJRuV9cZgyd2BLWK2v7rnmBXYR6C+RyH8XOYYOxZiXOCiZChNhjzMwMg== X-Received: by 10.159.241.1 with SMTP id q1mr31125526plr.383.1511565284698; Fri, 24 Nov 2017 15:14:44 -0800 (PST) Received: from midnight.lan (68-189-67-104.dhcp.prtv.ca.charter.com. [68.189.67.104]) by smtp.gmail.com with ESMTPSA id y83sm41020277pfd.66.2017.11.24.15.14.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 15:14:44 -0800 (PST) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@kernel.dk, Huacai Chen , stable@vger.kernel.org, Michael Lyle Subject: [PATCH 2/4] bcache: Fix building error on MIPS Date: Fri, 24 Nov 2017 15:14:25 -0800 Message-Id: <20171124231427.9563-3-mlyle@lyle.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171124231427.9563-1-mlyle@lyle.org> References: <20171124231427.9563-1-mlyle@lyle.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Huacai Chen 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 Reviewed-by: Michael Lyle Signed-off-by: Michael Lyle --- drivers/md/bcache/alloc.c | 2 +- drivers/md/bcache/extents.c | 2 +- drivers/md/bcache/journal.c | 2 +- include/uapi/linux/bcache.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index a27d85232ce1..a0cc1bc6d884 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -490,7 +490,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); diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c index 41c238fc3733..f9d391711595 100644 --- a/drivers/md/bcache/extents.c +++ b/drivers/md/bcache/extents.c @@ -585,7 +585,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; diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 5018c56ebb67..a87165c1d8e5 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -512,7 +512,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); } diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h index 90fc490f973f..821f71a2e48f 100644 --- a/include/uapi/linux/bcache.h +++ b/include/uapi/linux/bcache.h @@ -91,7 +91,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 */