From patchwork Fri Sep 29 19:43:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9978573 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 5E48760311 for ; Fri, 29 Sep 2017 19:44:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5126B298AB for ; Fri, 29 Sep 2017 19:44:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4602D298AD; Fri, 29 Sep 2017 19:44:59 +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 D686F298AB for ; Fri, 29 Sep 2017 19:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbdI2Toa (ORCPT ); Fri, 29 Sep 2017 15:44:30 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33047 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752556AbdI2To3 (ORCPT ); Fri, 29 Sep 2017 15:44:29 -0400 Received: by mail-qk0-f193.google.com with SMTP id b82so20592qkc.0 for ; Fri, 29 Sep 2017 12:44:28 -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=/1pNiUcB2H0QTzjoDHJS/ASG7We0yfrZWIAmv73vZ1k=; b=eHubiAL1SQD0VYO8DcARg954rEo2KKf9wKexmtBsCEaddn4YL1u/WfmPhMF0zH/JnX rYkIAArGCZsTQ90jefwHP2Z6573GaLDFOoGot9M8rPGET4EMVDgsTRm60eBtbd8overj 9UP9BXdY6OsOtnxnlMwLqiiyLQdm0J55oiIInykMu0s++OzSg8KTNrskQX07PkGQMGCD yUAXQBoz5wNE9bjNAFZf/mjdEOIZoO4sX3G0iPlQb7FpsPgSJ5r+AgUlxs0I/s62EOlw rNzllFeLuzi1wx0fhCPpA3LCDHQkW/i+SACH2Zfh7HgHtDMMLWOKJz9fOvo6frbtpfR3 IVKQ== 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=/1pNiUcB2H0QTzjoDHJS/ASG7We0yfrZWIAmv73vZ1k=; b=off8TtldZEmCZVxzkOUvEUM6bBfwXhEbeA6iwuN8QGDT2m5MuUKegxSA6hq4x1c+rC 3AgPNWFCZqU7SAOEh0LGQwXL0YIR2cFqvFWedMlhY8/auOwN4pIGa7adxDHACkkOMhA1 MqpK+9Y2DwJnxPQpep6GyR9VXra4Ff0ruzxe1O7KgYozQDCNFX4EEBzdN8RGlDNrELak EhzFEMis+K52HUxgteA96ZGUsBUuL6k4l8tWhVBY/19auiV2RrrSa2UhFKS6AiTQm+bn flyDEnjLpEDVAe8TxULi/HIndT45pfCDSo2xkIX530v656vaPfEtx8ZM8UvfipdBQxqw iR2g== X-Gm-Message-State: AMCzsaUzDHZBSplgw8INQLIrjUiT69bpa02X7R/lv8Z2zvkLXrF23ymW izmzzYMtwynIndw+TxTZYdWNymEQ X-Google-Smtp-Source: AOwi7QCYAP6AnlsWPfJ79Nffl3sy7iH/WfIcWgMlwnqdhvE2/SIg/zri8VbhASW/4Fw68EWSE0ErMQ== X-Received: by 10.55.217.155 with SMTP id q27mr4793990qkl.323.1506714268481; Fri, 29 Sep 2017 12:44:28 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id z22sm3150607qti.36.2017.09.29.12.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 12:44:27 -0700 (PDT) From: Josef Bacik X-Google-Original-From: Josef Bacik To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH 14/21] btrfs: remove type argument from comp_tree_refs Date: Fri, 29 Sep 2017 15:43:58 -0400 Message-Id: <1506714245-23072-15-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506714245-23072-1-git-send-email-jbacik@fb.com> References: <1506714245-23072-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 We can get this from the ref we've passed in. Signed-off-by: Josef Bacik Reviewed-by: David Sterba --- 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 b9b41c838da4..a2973340a94f 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) &&