From patchwork Thu Aug 30 17:42:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10582479 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 0D5815A4 for ; Thu, 30 Aug 2018 17:43:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE03228673 for ; Thu, 30 Aug 2018 17:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E251028681; Thu, 30 Aug 2018 17:43:21 +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 905ED28673 for ; Thu, 30 Aug 2018 17:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbeH3Vqf (ORCPT ); Thu, 30 Aug 2018 17:46:35 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:40278 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbeH3Vqf (ORCPT ); Thu, 30 Aug 2018 17:46:35 -0400 Received: by mail-qt0-f195.google.com with SMTP id h4-v6so11301781qtj.7 for ; Thu, 30 Aug 2018 10:43:19 -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=rdFMLganFUJmkufg/fNzG2rGuQGdhIppXIRGG3mh4TA=; b=dkgbkVXxP3RMEuImg/akojiAZjjyOOXo15jvBPGhGF4eJ9XMofVhdry0gjAhpPP0EM 46rJA+0y34dhyHpul+5GiF6UchVcd0ikFor4tlKe/G+BOL/M0Ma+muQCDqLxUY2oZIKR b+NkeAauuDXWGfrFzoDrWQqP/LA+YGKbkfXBxSq9ugIh5m9CiBGvW+0FCvyJpx1NyaRZ cMSqsd8cuF5IB99n880rKVl+BIJQMwRggAFxahAFj8HetL0P2eTwwOHia5RWg6zdXgO7 E7rOz21bt6WyQmTC94QWlaQmu+Ji3nxzuky6Ro3yydKUHhmukFsS9kxDPzO4rbT9++Xt MNYg== 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=rdFMLganFUJmkufg/fNzG2rGuQGdhIppXIRGG3mh4TA=; b=d49FytgagJw/bTbjgDTFD6V0Wi+jYGh6qBZ6TElUrfUkSKP4NlFxaFFmKncHeVh8Mn n1B3Fl0Ijm9vnZiWgjh6TI8IGEB9W/HzQKdiy1LBcSvO1Dus6sz/ZcCV+H0H3FWWbgxo TUdnoiqtNdw17y6dIgXuaMGUmG43ABUkP6iILrWch9iBHMZeF/0Dn/JMeNYNdXdHlh5k Mbj3M4X5ZJRePdA4WOacNDP8MaWj5AYtF7GjunU+3bxFhoLAV2zNz4+Qk1+v9EvdHzLk tz5Hd+aXiukfq096v/CELz6OgAxoTKV8ueCaLifRuMW4WLbA1JFmzjsoHiRfXfR88Ere NThQ== X-Gm-Message-State: APzg51BG8bdacKrRhn8qzXXxazXw3P50FAMT+EuvC67cwSWyz0gqsaRF TC0BIVefo7jhrkTX7RX/8Ip5/8jti7C99Q== X-Google-Smtp-Source: ANB0Vda5IhS3twcpG+DbR7ncp/4uBdr9KUBPhsuv2lmQgU//1OpSfR+TA7i6OMwYjSPnbjXV6g9fgw== X-Received: by 2002:a0c:d5d3:: with SMTP id h19-v6mr12666698qvi.218.1535650998889; Thu, 30 Aug 2018 10:43:18 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id n63-v6sm4291938qkd.80.2018.08.30.10.43.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 10:43:18 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH 28/35] btrfs: call btrfs_create_pending_block_groups unconditionally Date: Thu, 30 Aug 2018 13:42:18 -0400 Message-Id: <20180830174225.2200-29-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 The first thing we do is loop through the list, this if (!list_empty()) btrfs_create_pending_block_groups(); thing is just wasted space. Signed-off-by: Josef Bacik Reviewed-by: Nikolay Borisov --- fs/btrfs/extent-tree.c | 3 +-- fs/btrfs/transaction.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 031d2b11ddee..90f267f4dd0f 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2970,8 +2970,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, } if (run_all) { - if (!list_empty(&trans->new_bgs)) - btrfs_create_pending_block_groups(trans); + btrfs_create_pending_block_groups(trans); spin_lock(&delayed_refs->lock); node = rb_first(&delayed_refs->href_root); diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2bb19e2ded5e..89d14f135837 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -839,8 +839,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, btrfs_trans_release_metadata(trans); trans->block_rsv = NULL; - if (!list_empty(&trans->new_bgs)) - btrfs_create_pending_block_groups(trans); + btrfs_create_pending_block_groups(trans); btrfs_trans_release_chunk_metadata(trans); @@ -1927,8 +1926,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) cur_trans->delayed_refs.flushing = 1; smp_wmb(); - if (!list_empty(&trans->new_bgs)) - btrfs_create_pending_block_groups(trans); + btrfs_create_pending_block_groups(trans); if (!test_bit(BTRFS_TRANS_DIRTY_BG_RUN, &cur_trans->flags)) { int run_it = 0;