From patchwork Thu Oct 19 18:15: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: 10018125 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 AFAC760215 for ; Thu, 19 Oct 2017 18:16:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC33D28DCD for ; Thu, 19 Oct 2017 18:16:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A134A28DEA; Thu, 19 Oct 2017 18:16:34 +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 2886228DCD for ; Thu, 19 Oct 2017 18:16:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971AbdJSSQP (ORCPT ); Thu, 19 Oct 2017 14:16:15 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:46654 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbdJSSQM (ORCPT ); Thu, 19 Oct 2017 14:16:12 -0400 Received: by mail-qt0-f196.google.com with SMTP id 1so15589492qtn.3 for ; Thu, 19 Oct 2017 11:16: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=/iJx7+DJPRYr4dddfwiIkRET9IK9taadPUNlbZlS2+o=; b=XrDL4tIoaEFFNWWkD7u0C7ALQQlQqzVDjNjjnmjSeHmcf1rDM4sb3pIOd7I6VrMtS1 x92bxvZcL7a63qt/Zyo97hX5uQjUHLrbTY9yA7TSz2SduoRtpBeKPuILKi5OIVn1kqg6 gF10wNxXPjHX+whj+36B8HzTMnucB4MDIBumRR+qIDYTk7CUpEeYP8TTWdqT+mF/Jrt4 B38FO0+XEdawBeLLE1bq07s8y5StdoKxqSeGNqWkeyFJFz6oF2nQS3BV6ts/NcC8WqE3 in8gbdS7kchbTvdenxQ53DXEtK3PVSIlRl1NMKcXpilqsKNvsoAW0KJOfj40pTCknmhI 2ZIQ== 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=/iJx7+DJPRYr4dddfwiIkRET9IK9taadPUNlbZlS2+o=; b=Csc5nz0mt3LVBLDcQWtpoY8Uqlf1xUY4E+RCBj2EPfQhHel8MtRDXD8r18soWjXsPM RzZg8ZU8Pw6ID+Y26qbqISdfi6H0QXDVAhduAAyzpfPhElNoQKlc8VmO2ydeNDjVFKRr 79XndvLJ9hIpQQKAlgDe+u2sAcfaPXTxbfSyB9eaBpyjRV6xh1Fi83jdHuM/Eq4+/nGH 0K0XrCM6x1a7UEFqppkgBGWPooTR+pIUu/W8mB9XWboTmi14JWl9seifCgDKadV4kk7q Uy8bxnBL4vlEVMbCpdM9TgEqcOOzH0EQIIhZkShxRiuKM3P5L4fyUTKUOZqngzVcujey m/9w== X-Gm-Message-State: AMCzsaWWp7j1te2Htn3vPdKDFcTsN4SJH2agTpKCDDB7UYUQN5ukt42I 0EbBTlN54UmnRfHUwk6zwUVGRySS X-Google-Smtp-Source: ABhQp+QR8vuBre7XTlJjLICsQxOYAAMrr6pQeHabQlfknCdQvBlRMYSgZh+pvW3Qp1dzyTh2P1u1iA== X-Received: by 10.237.37.16 with SMTP id v16mr3476293qtc.53.1508436971754; Thu, 19 Oct 2017 11:16:11 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id g11sm10085556qtg.32.2017.10.19.11.16.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 11:16:11 -0700 (PDT) From: Josef Bacik To: kernel-team@fb.com, linux-btrfs@vger.kernel.org Subject: [PATCH 4/8] btrfs: switch args for comp_*_refs Date: Thu, 19 Oct 2017 14:15:58 -0400 Message-Id: <1508436962-6851-5-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1508436962-6851-1-git-send-email-josef@toxicpanda.com> References: <1508436962-6851-1-git-send-email-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 Make it more consistent, we want the inserted ref to be compared against what's already in there. This will make the order go from lowest seq -> highest seq, which will make us more likely to make forward progress if there's a seqlock currently held. Signed-off-by: Josef Bacik --- fs/btrfs/delayed-ref.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index a2973340a94f..bc940bb374cf 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -40,8 +40,8 @@ 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) +static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref1, + struct btrfs_delayed_tree_ref *ref2) { if (ref1->node.type == BTRFS_TREE_BLOCK_REF_KEY) { if (ref1->root < ref2->root) @@ -60,8 +60,8 @@ static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2, /* * compare two delayed data backrefs with same bytenr and type */ -static int comp_data_refs(struct btrfs_delayed_data_ref *ref2, - struct btrfs_delayed_data_ref *ref1) +static int comp_data_refs(struct btrfs_delayed_data_ref *ref1, + struct btrfs_delayed_data_ref *ref2) { if (ref1->node.type == BTRFS_EXTENT_DATA_REF_KEY) { if (ref1->root < ref2->root)