Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3289337imm; Sun, 29 Jul 2018 15:08:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc3J2RxqM3aHfWOnPflk8qCL0BEIKEBz26OIfvjC0FUvB/py75o0KC3Jo5kJf4jtGVnPbcf X-Received: by 2002:a17:902:8308:: with SMTP id bd8-v6mr14168528plb.329.1532902120254; Sun, 29 Jul 2018 15:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532902120; cv=none; d=google.com; s=arc-20160816; b=mu/8XlGJx9wVWZtBxtOHkWcn2cSFM/q80Maq8zDvLO17Z3isuROAK8aIItwwUyiT48 ucixsJqb0JFrgfynjNutkf80sjFuOozMuMdFYzVX3HZ6E+DXMcn7bbRxzPNP5a6Qh8xT LMbDZxkrZ8A164EfTkwgMvdbOQH0zkDnfBElZf75odcTQ3gsr1XpHtGhHAbjn3uBPFY+ 3TUZGOeuHTuWLHNWd5cu3FxdKg2wbUVw02W1IEk8wZ1T6Gun6WlCggKGnaImPWfy+wkI ehJzzcOgH/t+uoQPHDpK4Nj/ZL6cd3z2QPDwiDMSzJuZjJtBT3RkgMCLtQsZqqjzjHqa k+Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=QQHKvTPsB1qQUTEQN7GQUw9hNIy5jj7UdWQ2luJKFiI=; b=E7F+FRyQZ5L3Ka9p3HoA/VdSdzVRWVTxaA2ER0PhpCnWToKFBH0d3b8xpyIx9q0dha toxLE7KTH7sdswIKYFOuQz0AtYE3n3QcyhuszjdmOaCq5VeFBa9zWvA+sI6JTMILtJEC UUL0SnKRwMTShxBG2HhBw1i0UfAGQ8dugR1HeqsnJJqlNFCtaH4s8ZbMTOqRmEazL2YN wOJXZVSyxSDxXrLKB/heSq3pQw53JP+2O4ULaM+Y3HUzfz48US7gr4Ivh4N/c6YE5CLh Cm8yxei0IUIaEXgRmqmTAF/63Jowfnc/AxQwFobWvFknXf8TavxduNSGol1WlKnMrorQ teQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q126-v6si9442612pfb.277.2018.07.29.15.08.26; Sun, 29 Jul 2018 15:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732364AbeG2XiQ (ORCPT + 99 others); Sun, 29 Jul 2018 19:38:16 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51618 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729283AbeG2Xg4 (ORCPT ); Sun, 29 Jul 2018 19:36:56 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fjto6-0003Vy-O7; Sun, 29 Jul 2018 22:04:54 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Miklos Szeredi , Chris Mason Subject: [PATCH 09/16] btrfs: IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n) Date: Sun, 29 Jul 2018 23:04:46 +0100 Message-Id: <20180729220453.13431-9-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180729220453.13431-1-viro@ZenIV.linux.org.uk> References: <20180729220317.GB30522@ZenIV.linux.org.uk> <20180729220453.13431-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Cc: Chris Mason Signed-off-by: Al Viro --- fs/btrfs/transaction.c | 2 +- fs/btrfs/tree-log.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index ff5f6c719976..feb0348dbcbf 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -680,7 +680,7 @@ btrfs_attach_transaction_barrier(struct btrfs_root *root) trans = start_transaction(root, 0, TRANS_ATTACH, BTRFS_RESERVE_NO_FLUSH, true); - if (IS_ERR(trans) && PTR_ERR(trans) == -ENOENT) + if (trans == ERR_PTR(-ENOENT)) btrfs_wait_for_commit(root->fs_info, 0); return trans; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index fcfbe1d8584a..2c13e8155ff1 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2116,7 +2116,7 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans, dir_key->offset, name, name_len, 0); } - if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) { + if (!log_di || log_di == ERR_PTR(-ENOENT)) { btrfs_dir_item_key_to_cpu(eb, di, &location); btrfs_release_path(path); btrfs_release_path(log_path); @@ -5090,8 +5090,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, * we don't need to do more work nor fallback to * a transaction commit. */ - if (IS_ERR(other_inode) && - PTR_ERR(other_inode) == -ENOENT) { + if (other_inode == ERR_PTR(-ENOENT)) { goto next_key; } else if (IS_ERR(other_inode)) { err = PTR_ERR(other_inode); -- 2.11.0