From patchwork Thu Aug 30 17:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10582471 Return-Path: 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 111A95A4 for ; Thu, 30 Aug 2018 17:43:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3E6A284DA for ; Thu, 30 Aug 2018 17:43:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E825128676; Thu, 30 Aug 2018 17:43:14 +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 73EA4284DA for ; Thu, 30 Aug 2018 17:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727698AbeH3Vq2 (ORCPT ); Thu, 30 Aug 2018 17:46:28 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39583 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbeH3Vq1 (ORCPT ); Thu, 30 Aug 2018 17:46:27 -0400 Received: by mail-qt0-f194.google.com with SMTP id o15-v6so11288527qtk.6 for ; Thu, 30 Aug 2018 10:43:12 -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=CA+3sPpWVpECIxDBWrod57M0ejok1QEYG2zP0b1DHoc=; b=rG1VF7ZHEYvFlx4nGhIistNciSoYbzjhJP8lhN+eJtHSj7uLhGer3LFB92LKeIdNQ1 z/Rqn3Pwqjz479AQkyvsFxSXYef/T+oSAdyDm6o3ZfOi4g2kg5mqhW3fPfcg9PAx6TaV C4/7mLtFPkgEgNegCIH9NHtXpaxoSO3WHDjTG9FJI3lP2eanWuvSvoiU7CyiwMeEM7rc /8zwwDF3ob9mjkd8hiTomTNwoRn+2KIvl2vMYwrRLmxwN5Un6sNlMCAgzA2X4rPAwUdI 0bFEkdllvBBzw3tu0cXZWlJe6Be7EoM+oHO3FlSUI027Oa1bBzgx2K8993ZP4MoEUNls F0Yg== 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=CA+3sPpWVpECIxDBWrod57M0ejok1QEYG2zP0b1DHoc=; b=ATmp5iadWJfprbtjgGEzO1wVASQ4XZ02TbkFBbxXJVw5UomRsI+oIog0jEe6xuN/+D B3MeIB9Hi2qu4pIXgDOU79YOiikuV893AdvU2vBprCgAADYh3E2dMtGbyYWukF6IBRZQ vefnP8lmMNbnoiX1tyetRtg6DT/7djyZz6rfnHJJ6McTGqSsQjr80LIPF1fUooX85whM C2s4OugmML/i349iBe1DDJ1jLMSH/D4JgV98SQvze9ZgGA6riyoms6YJiOKEEje+N8+9 9RDh8XpjkvSffXcku0Aqz3IKW3hR+02fmn9IozxmIqHli6S6yLl36b84ub3plAMg5YPD SmAg== X-Gm-Message-State: APzg51C2pv/V1ymGTEKMkrNF/1/Gxwib94OF+EwOxeWYofP9l84zJc8N tTqybS6Nleyy+lsJiijCaOn1954R0+GTfQ== X-Google-Smtp-Source: ANB0VdbakfnzMFzdLS0M7GfYmolvU18zvUbrLPsc2xF4zA2DMbqPft+awdITaNylTLm1vQPevt33wQ== X-Received: by 2002:ac8:38a7:: with SMTP id f36-v6mr12979953qtc.337.1535650991798; Thu, 30 Aug 2018 10:43:11 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id b11-v6sm4261389qkc.71.2018.08.30.10.43.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 10:43:10 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH 24/35] btrfs: pass delayed_refs_root to btrfs_delayed_ref_lock Date: Thu, 30 Aug 2018 13:42:14 -0400 Message-Id: <20180830174225.2200-25-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180830174225.2200-1-josef@toxicpanda.com> References: <20180830174225.2200-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need the trans except to get the delayed_refs_root, so just pass the delayed_refs_root into btrfs_delayed_ref_lock and call it a day. Signed-off-by: Josef Bacik Reviewed-by: Nikolay Borisov --- fs/btrfs/delayed-ref.c | 5 +---- fs/btrfs/delayed-ref.h | 2 +- fs/btrfs/extent-tree.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 96ce087747b2..87778645bf4a 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -197,12 +197,9 @@ find_ref_head(struct rb_root *root, u64 bytenr, return NULL; } -int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, +int btrfs_delayed_ref_lock(struct btrfs_delayed_ref_root *delayed_refs, struct btrfs_delayed_ref_head *head) { - struct btrfs_delayed_ref_root *delayed_refs; - - delayed_refs = &trans->transaction->delayed_refs; lockdep_assert_held(&delayed_refs->lock); if (mutex_trylock(&head->mutex)) return 0; diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h index 7769177b489e..ee636d7a710a 100644 --- a/fs/btrfs/delayed-ref.h +++ b/fs/btrfs/delayed-ref.h @@ -255,7 +255,7 @@ void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans, struct btrfs_delayed_ref_head * btrfs_find_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs, u64 bytenr); -int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, +int btrfs_delayed_ref_lock(struct btrfs_delayed_ref_root *delayed_refs, struct btrfs_delayed_ref_head *head); static inline void btrfs_delayed_ref_unlock(struct btrfs_delayed_ref_head *head) { diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index fc30ff96f0d6..32579221d900 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2591,7 +2591,7 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, /* grab the lock that says we are going to process * all the refs for this head */ - ret = btrfs_delayed_ref_lock(trans, locked_ref); + ret = btrfs_delayed_ref_lock(delayed_refs, locked_ref); spin_unlock(&delayed_refs->lock); /* * we may have dropped the spin lock to get the head