Message ID | 20180911175807.26181-27-josef@toxicpanda.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-btrfs-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C450014E5 for <patchwork-linux-btrfs@patchwork.kernel.org>; Tue, 11 Sep 2018 17:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B04A229B9F for <patchwork-linux-btrfs@patchwork.kernel.org>; Tue, 11 Sep 2018 17:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A510B29BA1; Tue, 11 Sep 2018 17:59:00 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 57B5329B9F for <patchwork-linux-btrfs@patchwork.kernel.org>; Tue, 11 Sep 2018 17:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728339AbeIKW7Y (ORCPT <rfc822;patchwork-linux-btrfs@patchwork.kernel.org>); Tue, 11 Sep 2018 18:59:24 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:33048 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728113AbeIKW7Y (ORCPT <rfc822;linux-btrfs@vger.kernel.org>); Tue, 11 Sep 2018 18:59:24 -0400 Received: by mail-qt0-f195.google.com with SMTP id r37-v6so29221046qtc.0 for <linux-btrfs@vger.kernel.org>; Tue, 11 Sep 2018 10:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=if0+P3zEhcXbyqo3Gqbg4RTnabPav/Nw51UXbWrp0Ys=; b=wLruVB/CCliaB0scn/ZSwIDSjPazJqFFtX7GFzMPWkRzyyBBEi4DeNEZ6funzMerb/ s14wJUgKlBUCBzcfXaDYlWSfBy2GZ4sr6S8Z/p2kMOYJdAQRwP+t59dw67jivD7ab7FU ZRGVwX2L5xjvyQqdgX8ox61RJFIgsdDUX/bVQpVlYVsYzooCJDRz3TwuU98m9wvYTaiQ y+bA9AS5zEUf1xnKG8HWgc5qSNoOydIA/3FJ/P1rLRj815K5/hD41G0JgC3Bm7OI2u5m CuZ81uqCgTFuKVwqovLPuQWl6s4hyZySWQLmdKeT6CvE3xgtDIYeyqqNG8fMcFPMAK5Z A04Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=if0+P3zEhcXbyqo3Gqbg4RTnabPav/Nw51UXbWrp0Ys=; b=TaihcSzLv9LXksfSMW9RisyAFMxrpWy/NcU81ky8WdDlTHo8kqY+NS7z7QmqNthhRo eU65mAm3Dk9ezvP79JTWzW4Ipnez6SP20e8x0DokDAN+s1xqccGzAg2VwPiAVgEA+FSx uUCHFEIr8ufn6CptZHpBTHcLBeeMOPRjHLV61h18fyNqeCKHFmMnnCoGB4XrMRwo8O+m E67y4jSKjYW9sdd6qonmayQQBqyeriqftLM4j0mJuaFkj95HADiAISfg5MDmUfs4I3lo CwWBSBu7Bo80Zn1whxhjVUErUCy4sczEdlDD0TBZoq58Tvw2fUZgBrbY9I7EqDjMwTYj ZTHA== X-Gm-Message-State: APzg51BMjYw/bVufzmH+BYDU4rWp+S5uyK9fQUBc0ZbvIw4ojxkSJ1cM JpxwwFAPi2+UNWnYK+E2hF7Kdw== X-Google-Smtp-Source: ANB0VdYzMfE7ap11jnnCysX21im0ePI48LgsS90aZcGnUZUteG+i41LTV8WhXIerMe1kIvsjMbJcew== X-Received: by 2002:ac8:6056:: with SMTP id k22-v6mr20579741qtm.94.1536688738445; Tue, 11 Sep 2018 10:58:58 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id i125-v6sm11002589qke.36.2018.09.11.10.58.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Sep 2018 10:58:57 -0700 (PDT) From: Josef Bacik <josef@toxicpanda.com> To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH 26/36] btrfs: make btrfs_destroy_delayed_refs use btrfs_delayed_ref_lock Date: Tue, 11 Sep 2018 13:57:57 -0400 Message-Id: <20180911175807.26181-27-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180911175807.26181-1-josef@toxicpanda.com> References: <20180911175807.26181-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: <linux-btrfs.vger.kernel.org> X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
My current patch queue
|
expand
|
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 11ea2ea7439e..c72ab2ca7627 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4214,16 +4214,9 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, head = rb_entry(node, struct btrfs_delayed_ref_head, href_node); - if (!mutex_trylock(&head->mutex)) { - refcount_inc(&head->refs); - spin_unlock(&delayed_refs->lock); - - mutex_lock(&head->mutex); - mutex_unlock(&head->mutex); - btrfs_put_delayed_ref_head(head); - spin_lock(&delayed_refs->lock); + if (btrfs_delayed_ref_lock(delayed_refs, head)) continue; - } + spin_lock(&head->lock); while ((n = rb_first(&head->ref_tree)) != NULL) { ref = rb_entry(n, struct btrfs_delayed_ref_node,