From patchwork Wed Oct 20 07:23:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5pOO?= X-Patchwork-Id: 12571787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAD51C433EF for ; Wed, 20 Oct 2021 07:23:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC35D60F59 for ; Wed, 20 Oct 2021 07:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbhJTH0J (ORCPT ); Wed, 20 Oct 2021 03:26:09 -0400 Received: from mail-eopbgr1300124.outbound.protection.outlook.com ([40.107.130.124]:17856 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230061AbhJTH0I (ORCPT ); Wed, 20 Oct 2021 03:26:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XPAZZkCxv7JRugQZ8kHdZko8vdQ9x5+YWh0JbPZQ8mh943dRUaJT5UXrIMYPlC1HDradvHsJygMc+grzFJwUfRzqXxVjGVorhp+ZcwNBrmDcVoS+N/YMGByazSr/4K75f0li0TVOvNGMrcmtN1BRubEXFiDXUQ12aZdib2TZHIBsUFwagVyJsNwIE7lFcJXMX149n5DfWPPTQquK6fXQwfo1eWbR4OUzTkiv1TsLzWU1RulFnRKA5lcMsygSzp2XbTW6Aze0iP98PDU/dKUhBi2ThKhCh1KUyEJsHBsd6Nyr8wkJAWz4pjgsYw47YF2RtfkzjmkNtVYQWr1Yoa9Whg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f4xan3PItXj5j22TJ6rbNfBxfqENKBYRh7FyHGlfOjk=; b=KGFlakcpWL6N61Pvd/5WB916/fDQvmAA7FHXApLYY5ro9lwo2awa+lyBR3FdXS9xTLC8dJtedo8dXbhU25+LzexePaTM3EENpoBw+lxH7z976s/rG3pzyYLlpgvtPrDss2pKCNMNRcJUt+WlHHd5GyiUjme/HI0oUqimfca1or/NJMBaUVjLu6RZ4gTM50IqUg3u0gATBG3ybIDwl+ZFDBB5+Mf7IQAYbU48iW9YGChA5nE7PXiZnWEzRe1L4h2agDuEsbovnfUpa45MGVAPUTm19Y62zT7KKbhox8Ve9f6YipsXuPEE/zSiEUC0r4KrV0NG3V3paKTuX1uYU1d5dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f4xan3PItXj5j22TJ6rbNfBxfqENKBYRh7FyHGlfOjk=; b=eJfKfQ9xGoePGgxhFmCmo390B3SCubZT/yQf/gmtCn/WZCsGnd4beLWPe90Df0hfXKcL1pDA+nojRJjGJAlcHIPV+PP76osfDDyBxLYrBWGZvG39s1Vt5G7LPYC8jrDifwMtbhJu33Ssu2zAovxmbrDmPT/XTw/ElK78TbLXsCg= Authentication-Results: fb.com; dkim=none (message not signed) header.d=none;fb.com; dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by SL2PR06MB3114.apcprd06.prod.outlook.com (2603:1096:100:34::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Wed, 20 Oct 2021 07:23:52 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::4c9b:b71f:fb67:6414]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::4c9b:b71f:fb67:6414%6]) with mapi id 15.20.4608.018; Wed, 20 Oct 2021 07:23:52 +0000 From: Qing Wang To: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] btrfs: simplify redundant logic judgment Date: Wed, 20 Oct 2021 00:23:41 -0700 Message-Id: <1634714621-58190-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: HK2PR0302CA0008.apcprd03.prod.outlook.com (2603:1096:202::18) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 Received: from ubuntu.localdomain (218.213.202.189) by HK2PR0302CA0008.apcprd03.prod.outlook.com (2603:1096:202::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4628.9 via Frontend Transport; Wed, 20 Oct 2021 07:23:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e89bea51-a947-40d5-2136-08d9939a9108 X-MS-TrafficTypeDiagnostic: SL2PR06MB3114: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:962; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d33TSrXoteSGE20p9LPznCN1N/Vb0jmeD8l3SuX8eHkUkwvJbC33Xxj/du9SdVNbsnx5LYFktjmjqMMMeOano8bJlDp4RquUPfu1KonhGnSGNuyScKSbWV2VJkA8Qf2fz7QEy5XkiuAHw0t1eMZ2LbZy7zm1KJtGo4poZRFfBD4M13P0aLY6G8GXsIr5wWq9HuJYIQMLdycTUMRZ5NDEnt4Pmk0u2s9LUlwc4zmQX6XTd503jcf4+R+2+iCDbf1B/gITjMCDh5fILv7isyA3Y9Fjwb/4fTP+CyKKYfI2BevG1BafeT3TaDAXPtQR0mI9FZwrC58WNPY/kz7R/Mo2efkqfs3Wk7dIWG7jPG7VG5zij71GrvCgK4Wfb70I0a6dBl0MSh4YfWqmDW3qxJrucqOkIapS/vR49JOBveI7JSDynotp9m5rE3QBzDqosrGrm8fYgHVSYVxIkdoGgbWTV6s3bBEl5CvC26cUabsUOdQTtrGzyTOcr6xCkpmF9HkoDooXLmqh/s3HaiS2TZrvu1CwvhFnp2NXd+Do78q9NqgJU522HEOVJVFWXaQP/ltZGazSZvA0TAgu+Ttk6Sf2adH77eUCbGnvZ+BzMvUMbbNDqOY20YTrKft+FK1gViUmW2u1KYmAXjrGuD5cFX2svUdT0vh7yZBfX6c3I2lI51sbo4viLJsXuj+3uJt4LORZXh+qi0Be+O9wACN0iIaPTw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR06MB3082.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(508600001)(4744005)(110136005)(26005)(316002)(66476007)(52116002)(5660300002)(6506007)(66556008)(83380400001)(6666004)(38350700002)(6486002)(38100700002)(86362001)(6512007)(956004)(66946007)(36756003)(4326008)(8676002)(8936002)(2616005)(107886003)(2906002)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h4JaGBNT2gdb9xghWCNf5ZZdhqB5oeUzx3gmae5rL0y4t6lSltbkS7eypLFDD4igt4iWe48CCXv4pSbZNNT9c60NBrJoTHtdWOdAuNxIPocCVlti+lqmUPeiB2EOCZ27TLEA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btXViffS3MJCbkdPMBch95s9P8qAAqoV37k0fQvzCD2bcXmJBNWI3aT/SmN1TL6aBKjG7joys1xUdTzPG4qfG2EgPGPZIfWiIOSIqGosHHYXtaueqOc88cIiCZUnJf/WBP8j+WAxRcbbCRGI1giQ3/fNvsw1/0CovFx6U7joLfLbr7zAcU+TMcwJ46sCVZshi0pTsbo0LwVjswWbbPbdvtNRgXkVRNqZMMQqXN4qVfQLSbtGOx4qqPckHqrQuA1nUt96XjfI1hbzs7Dep6v14gy8Fkfb5HzrBVQSW/BI1/xogdnxouZZZg1rTmW1CSzdQIXAjyGrQPrYcTYgBYOWlOtFPetXJsI+sv4AQBF3JEyhhCQ0Whs7FY02SG3/4xwxXhufC3arxt7Y7ss0eBHcWEIGBVnWdwc6ewApgNnBHnqJKWEShpla4ceKyB0E= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e89bea51-a947-40d5-2136-08d9939a9108 X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2021 07:23:51.8810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g0TpprEO6n0E78Hz+sO1yXGD5l+l/+4WPYA/YsAwuYKhKEyWPX6nogaCPphgNZSlgU3aYK6ye8+Owy7iQFQsow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2PR06MB3114 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Wang Qing A || (!A && B) is equal to A || B Signed-off-by: Wang Qing --- fs/btrfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 07ba22dd..e0d2660 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2011,8 +2011,7 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page * to use run_delalloc_nocow() here, like for regular * preallocated inodes. */ - ASSERT(!zoned || - (zoned && btrfs_is_data_reloc_root(inode->root))); + ASSERT(!zoned || btrfs_is_data_reloc_root(inode->root)); ret = run_delalloc_nocow(inode, locked_page, start, end, page_started, nr_written); } else if (!inode_can_compress(inode) ||