From patchwork Mon Mar 19 00:36:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10291491 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 A6C33600F6 for ; Mon, 19 Mar 2018 00:37:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9936D28D4B for ; Mon, 19 Mar 2018 00:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DC9628F56; Mon, 19 Mar 2018 00:37:15 +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 1F48828EDF for ; Mon, 19 Mar 2018 00:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754783AbeCSAhO (ORCPT ); Sun, 18 Mar 2018 20:37:14 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42612 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754737AbeCSAhD (ORCPT ); Sun, 18 Mar 2018 20:37:03 -0400 Received: by mail-pg0-f67.google.com with SMTP id o14so2013975pgv.9 for ; Sun, 18 Mar 2018 17:37:03 -0700 (PDT) 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=1BtlWLT2N53vQKwabHHbgUVOBPR33qiq6PsDPP/0VWo=; b=Y9jN5g0umPE7GhEmtt/6j+v3p01dx9UriqguhFhu2ez5WwtAzNG7eCeYWMDA4PbIHa NW6yg6P1uIsr3M5SBs8jWeAlmrKlzGoZu5/it0BAt5fo/E489k3ORX2+GTW19PURXmQy m8aAvyfT19nmReUafrZ0ddZ0Fcx3l34IAxcIofTeJro7f3cD1MpL5+rdHiB9F1K8WGkR 9w7Yb8R3SvJBQln5aZi70AMfsb3m8TPwxNksFa/vsepttS9z4Eq66TrY1c0KwvQpZqMq ppfz+aV78/43IJDM8wkEMrBRtrEfXkdTL+lZCFuHUluTXSWf34+ih62OIRmNsBs4v7Ym iphQ== 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=1BtlWLT2N53vQKwabHHbgUVOBPR33qiq6PsDPP/0VWo=; b=qLofBCFNxwBQdU69mwj1Msnd10cBZ98RvNgF6FCxl2IuB/ARqWtaoh4M/ztG/4KrWr 4XL1mc3JLWEPVd6qy8OZdApwkjmT+bIeZ+99FRxRyypeJLgXDKEEnRDOs2cFQBMP8sBN SrROD9h/9Lg60BI9a3CE2LG4i1UYN15vMQCMAeAK6kISigS5tPwn3+S2XG06Vhp2Y759 kGXrmN59zt0zrYFjsKVsGfRR6hVQlREU5uNQpcSXB9kOltDRhqeXA2Vt3kr93wjkq/Gc 2xRGhZioVt0vzv+zX6c62BNS8Jf1gJaFxIWIzHNtLlvmi+V1z3Z2UQjooRLnbSv5nIv2 /pOQ== X-Gm-Message-State: AElRT7ET9RMPpzGZBlOCCvgJfJVJ2drUnC9W+vbIrmXtwYvzSJYwrs5B V7GbkhmswaORgay5dPncmLxzrrocsjg= X-Google-Smtp-Source: AG47ELssny3vDWSTHF9PWlbfHOSIL4qXUfjCJhVNZnIqs6bG/MqY8FDRL5vIwLLhNAudrSYrKctBsw== X-Received: by 10.101.66.193 with SMTP id l1mr7612680pgp.57.1521419823003; Sun, 18 Mar 2018 17:37:03 -0700 (PDT) Received: from midnight.lan (2600-6c52-6200-09b7-0000-0000-0000-0d66.dhcp6.chtrptr.net. [2600:6c52:6200:9b7::d66]) by smtp.gmail.com with ESMTPSA id a17sm27674857pfc.122.2018.03.18.17.37.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 17:37:02 -0700 (PDT) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@fb.com, Bart Van Assche Subject: [for-4.17 19/20] bcache: Reduce the number of sparse complaints about lock imbalances Date: Sun, 18 Mar 2018 17:36:32 -0700 Message-Id: <20180319003633.27225-20-mlyle@lyle.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180319003633.27225-1-mlyle@lyle.org> References: <20180319003633.27225-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: Bart Van Assche Add more annotations for sparse to inform it about which functions do not have the same number of spin_lock() and spin_unlock() calls. Signed-off-by: Bart Van Assche Reviewed-by: Michael Lyle --- drivers/md/bcache/journal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index acd0e5c074dd..18f1b5239620 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -594,6 +594,7 @@ static void journal_write_done(struct closure *cl) } static void journal_write_unlock(struct closure *cl) + __releases(&c->journal.lock) { struct cache_set *c = container_of(cl, struct cache_set, journal.io); @@ -705,6 +706,7 @@ static void journal_try_write(struct cache_set *c) static struct journal_write *journal_wait_for_write(struct cache_set *c, unsigned nkeys) + __acquires(&c->journal.lock) { size_t sectors; struct closure cl;