From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15299C7EE23 for ; Wed, 31 May 2023 12:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232018AbjEaMhS (ORCPT ); Wed, 31 May 2023 08:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbjEaMhR (ORCPT ); Wed, 31 May 2023 08:37:17 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B372E2 for ; Wed, 31 May 2023 05:37:16 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 43FBF68B05; Wed, 31 May 2023 14:37:13 +0200 (CEST) Date: Wed, 31 May 2023 14:37:13 +0200 From: Christoph Hellwig To: Qu Wenruo Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Subject: Re: [PATCH 6/6] btrfs: remove need_full_stripe Message-ID: <20230531123713.GA26932@lst.de> References: <20230531041740.375963-1-hch@lst.de> <20230531041740.375963-7-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, May 31, 2023 at 04:52:53PM +0800, Qu Wenruo wrote: >> need_full_stripe is just a somewhat complicated way to say >> "op != BTRFS_MAP_READ". Just spell that explicit check out, which makes >> a lot of the code currently using the helper easier to understand. > > In fact the old "need_full_stripe" can even be confusing, as > BTRFS_MAP_READ with mirror_num > 1 on RAID56 would still need all the > stripes. Yes, that's one of the reasons. And that in general in the conditionals READ/!READ tends to explain the logic better than !need_full_stripe vs need_full_stripe.