Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp734399pxb; Thu, 21 Oct 2021 08:30:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4kxmDFIWptkMU/tro8veUE098Vthpou0c4WFqTls04lsB8yZQUnYKkHwbQskjsIxvfrKy X-Received: by 2002:a63:af50:: with SMTP id s16mr4938989pgo.119.1634830202777; Thu, 21 Oct 2021 08:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634830202; cv=none; d=google.com; s=arc-20160816; b=SrQ8AQBfgeWBLNd5o5JTpvVXedTcl6B/jybqZw+g+RmHMHMnyLE50ZGON118XxTUKV gts1/oO1amJqbm+dChrmi3vPGXf+tgM1KJQ0PnJuegOOh6P+FIl1BApW4HU016Rz5DGd zLKflYB3KtzbWhbzr8ljbtUyuWrkcmWC++WhseEuipgqhTFluDSFj+Fk+iJYHQPvZJkD 0zHWp17Td5Nwx6Pd7J7ALB44yKSqHr2QhYnCvefZcUkMTHFFUl9HV7RjWGuempWlZTcH WyRoil+acivR9k+tNX63Y7Jq5qclDc+JaftP4v4c5YBglSZHW34YR2cGuGur9tsCKDFu Ti1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=/h5uas0IEOUEzn71YXpfTwJ6JyDWRRYuRQG6zdwEbDI=; b=ft/EP+OXB/m2eo0KyNQr5rwtq2HD7bmXQtb/dtGUH+mvMAzOv+9iP/m87M7PCu2+3B +rQ3f7PjHQhGMOMEW4tHP0w6sZfDHwV8eiGNav1upiRHjXseF73yon5hI3ZTgb4AOdYG FWRvMHe/PNwvW2bwyXu/qHGacLEAPwrBehkAlDEOjeMzZlE7cksypV5rlcu7xh/bc2Z3 xD0WVpZJypTGgnfROcZAP+uVW/2vlUaa1gFpCm37Gx4r4JQaCVLo3aw3rg8cMMkPgJJI IpfRpS7uEws3Sgom+p/5YOSyDt8JTCUIrOXgS4iqtSSssbdrLlH0ee9s9zVtX5002BTw jnsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Q5udNCb6; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si7659599pfe.215.2021.10.21.08.29.49; Thu, 21 Oct 2021 08:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Q5udNCb6; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbhJUP32 (ORCPT + 99 others); Thu, 21 Oct 2021 11:29:28 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:51050 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231891AbhJUP3Z (ORCPT ); Thu, 21 Oct 2021 11:29:25 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C5D1A2198C; Thu, 21 Oct 2021 15:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634830028; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/h5uas0IEOUEzn71YXpfTwJ6JyDWRRYuRQG6zdwEbDI=; b=Q5udNCb6JXM45MPLj46nHK+KEV0SbFv1YAk4e90CE+IkrXmZc6E818jTuw6j+6yFAraM6h 0NlEW7cF28kuVFbCz/sNEjfAck2I5I00HSLP88ZzFUIN75lPqlra7fOo7kCkyjnZsh8+u6 G/jBfG1+Ri5SRXQ7olPTba8Kw8HEHyw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634830028; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/h5uas0IEOUEzn71YXpfTwJ6JyDWRRYuRQG6zdwEbDI=; b=UrBJQPylBVo5MnXTtPaj7tUa/+Qwlw1vOPy+l0Zv+Ql7BPD1Ib+L9/E1dyRlnLIVRmaAJP kSae9JyiW3ArhzBw== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 88C4BA3B84; Thu, 21 Oct 2021 15:27:08 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id DA842DA7A3; Thu, 21 Oct 2021 17:26:39 +0200 (CEST) Date: Thu, 21 Oct 2021 17:26:39 +0200 From: David Sterba To: Qing Wang Cc: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: simplify redundant logic judgment Message-ID: <20211021152639.GB20319@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Qing Wang , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <1634714621-58190-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1634714621-58190-1-git-send-email-wangqing@vivo.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 12:23:41AM -0700, Qing Wang wrote: > 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)); Thanks, but somebody already sent such patch and we'd like to keep it as it is for clarity.