From patchwork Mon Sep 11 21:12:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9948141 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 C96176024A for ; Mon, 11 Sep 2017 21:13:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B217428D62 for ; Mon, 11 Sep 2017 21:13:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A72F528D64; Mon, 11 Sep 2017 21:13:10 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 335F528D62 for ; Mon, 11 Sep 2017 21:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751224AbdIKVM6 (ORCPT ); Mon, 11 Sep 2017 17:12:58 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35896 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbdIKVMz (ORCPT ); Mon, 11 Sep 2017 17:12:55 -0400 Received: by mail-qt0-f196.google.com with SMTP id t46so553075qtj.3 for ; Mon, 11 Sep 2017 14:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q1Z3Kx9m04rXu8YslBsHA6hbYqjdeWY7J6VZSD9Suc0=; b=gU3s9NhnQYBpRGURyJpKZrY8B3f1Zz0sHR8GY/0bxtOgXIfMp5oJEfB3ZEhLaCB6QP QkMei73EtTkKCPUiYITqAtVfngaHF8t6qK25rm+rmWKsmTmghl7WhAKWm/LXnsq4CGcb X2fEe8ZqMnQZ1Lx66GYyvl4AW/0cicArHbgFqxEZPV6EG+hr6UxOwY+YUfO2BEy1gTbz rH2JRtwyTz6pT8W4C2uuK3RecLhsTJ7zl5wKCNT3UhVYF4YS48TrlnqyDb/0rjtw8wu/ cMDOz2yS8nR77FMO6h7D1pMM7j4RLZt5DcLuovxs5rZbVzRRfwx+emZWz2ONvLDOn18t nadQ== 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=q1Z3Kx9m04rXu8YslBsHA6hbYqjdeWY7J6VZSD9Suc0=; b=OMiRDAxu/1oq+CiwzewtJDzKfGxn1XG7Sf6JCl7aLCmVo4EOt8GMw/nZtFm8cPWRz8 9x453XayWnHGy813NmN5b8Vh93OI5VKjeh9bmuVs5u+yfEGW5DG28TnyonexzlTLHloy YH10yqgF6cNdEXLC8aKSEXicJRrnNvcBVBxnE5X81REESJ36UAp/g4GNUEnpCABHeqIw Bkfv3mAw4BChZfjDVmO5XVL4Y9QAallixNgDsPviRhMxiVMFx45LstYy9vjeeAfjJV6j QjA65XDzHvj5m9JbMjOpnB34N5RiB36rXPKJkXkGZsLtKldKqqze5B9CS2jmKJa5/g7O SRQQ== X-Gm-Message-State: AHPjjUgadOKeVrJ9RsCUh54pbJTcVh5exEluE+6blGmyjxJS/wBmeb5z ycIFkdt7rjiMk+B0YFc= X-Google-Smtp-Source: AOwi7QCGqmdUMlVovHKVwkjEIqqT+hP1LyucSqTwBtTreh5bCKFTEtnBCnWyaUtHE3LlTxrfWM82Dw== X-Received: by 10.237.53.175 with SMTP id c44mr17077773qte.209.1505164375193; Mon, 11 Sep 2017 14:12:55 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id z1sm6833456qtz.87.2017.09.11.14.12.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 14:12:54 -0700 (PDT) From: josef@toxicpanda.com X-Google-Original-From: jbacik@fb.com To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 07/10] btrfs: remove type argument from comp_tree_refs Date: Mon, 11 Sep 2017 17:12:33 -0400 Message-Id: <1505164356-13474-8-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505164356-13474-1-git-send-email-jbacik@fb.com> References: <1505164356-13474-1-git-send-email-jbacik@fb.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 From: Josef Bacik We can get this from the ref we've passed in. Signed-off-by: Josef Bacik Reviewed-by: Timofey Titovets --- fs/btrfs/delayed-ref.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 7cb1172..7374710 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -41,9 +41,9 @@ struct kmem_cache *btrfs_delayed_extent_op_cachep; * compare two delayed tree backrefs with same bytenr and type */ static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2, - struct btrfs_delayed_tree_ref *ref1, int type) + struct btrfs_delayed_tree_ref *ref1) { - if (type == BTRFS_TREE_BLOCK_REF_KEY) { + if (ref1->node.type == BTRFS_TREE_BLOCK_REF_KEY) { if (ref1->root < ref2->root) return -1; if (ref1->root > ref2->root) @@ -223,8 +223,7 @@ static bool merge_ref(struct btrfs_trans_handle *trans, if ((ref->type == BTRFS_TREE_BLOCK_REF_KEY || ref->type == BTRFS_SHARED_BLOCK_REF_KEY) && comp_tree_refs(btrfs_delayed_node_to_tree_ref(ref), - btrfs_delayed_node_to_tree_ref(next), - ref->type)) + btrfs_delayed_node_to_tree_ref(next))) goto next; if ((ref->type == BTRFS_EXTENT_DATA_REF_KEY || ref->type == BTRFS_SHARED_DATA_REF_KEY) && @@ -409,8 +408,7 @@ add_delayed_ref_tail_merge(struct btrfs_trans_handle *trans, if ((exist->type == BTRFS_TREE_BLOCK_REF_KEY || exist->type == BTRFS_SHARED_BLOCK_REF_KEY) && comp_tree_refs(btrfs_delayed_node_to_tree_ref(exist), - btrfs_delayed_node_to_tree_ref(ref), - ref->type)) + btrfs_delayed_node_to_tree_ref(ref))) goto add_tail; if ((exist->type == BTRFS_EXTENT_DATA_REF_KEY || exist->type == BTRFS_SHARED_DATA_REF_KEY) &&