Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1586253rwj; Fri, 23 Dec 2022 23:24:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXv5trbBeyMfSdNX1pDEoDaVH3afAbRLdi0A8VfKci3Bsp3RgXgZjhny2r/S/QwuhOGKTI4N X-Received: by 2002:aa7:914e:0:b0:574:35fd:379e with SMTP id 14-20020aa7914e000000b0057435fd379emr14114059pfi.2.1671866680321; Fri, 23 Dec 2022 23:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671866680; cv=none; d=google.com; s=arc-20160816; b=GKNP4u1UUV5eYHIBA7jsVGcyXFDHfmGzXwNNfdRFhQuqR+vabnxt41H5DTEbA2wtTx hy9Kzw/t7DUeeqjJ9RPuZUchZwjrkwFu7UIjpX7QG6+uyMCq0txEWhWFfTsD6yB4Veq9 bpHFct2+sQbLCkgl83o70u3Hh1QJmGoWaQxLOfMTnf1+oXEM7F9yjPcSiYZ93EgIsUhu +ulhQnmU12pVoXmUE3+4yWa6hRnGPEycxciNNqPQFZtv9jEj3gzkAdcQXKKFjitAK/JD g/F0GwQWYQkJ6DWcCMeDNfwz/ZrXMd4T/fY9J+zhAc94Pyz85S/meaAgX3hLU/SBdbM3 zYaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YgyS9Hi5REvv1K/NGxcEShlxYPQgP5TjuKggBBZ0AXE=; b=MDboKuFGlok4hnh24mydwnELH3+ETPQ9khcOzjaJoT7i8Ni+OxITip84xkSYZxwJJM aPFS7S8Id195DzGbqg50KJd5T1jHmzx0H02Llpj0+BKbi5JxQ1nh5cCavLtJb+bj2YgK p968XE/FZFBLQ8JVafkVqQz6fmgZ+j2ceGzKXflIec/4Dezrs0GwjPhtmDGnnES4I4G4 brI83UN4PbbkCLBZex37hzoFgjefcbnxlPhqpydsTdfv+y+6Ijf/PTkR/LUg+nx1ORMF akjL7d63tMdF9agPfC5FwnfDvPBKg3QP5YIc2OqixpExVXuLG2w/p0M+oj50btoadUMk VypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=EFJCqV3y; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m186-20020a6258c3000000b00546ce9189b1si5418992pfb.65.2022.12.23.23.24.21; Fri, 23 Dec 2022 23:24:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=EFJCqV3y; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbiLXHVf (ORCPT + 99 others); Sat, 24 Dec 2022 02:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbiLXHVe (ORCPT ); Sat, 24 Dec 2022 02:21:34 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F6712ACF; Fri, 23 Dec 2022 23:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=YgyS9Hi5REvv1K/NGxcEShlxYPQgP5TjuKggBBZ0AXE=; b=EFJCqV3y2QPxOmS8ITM38KaR2P uR3WTFMx5W2pVWreyJapHzU5dZPfMwzpB1pjkr59JlE16ozG4ptqVBBynVROPEAGRwGN5EbD2Xkt+ W00//KiOW2jIe6wM18pQ7qLUcfcYnxg7v+oelGjbAbNk9JrX9N4+HYvFbTtJX18FTVj8gnX4f1/yI pdcm40a7+lXBMzvU6SOT0vs33CtsqSUyP2rQGplxXbe9F8cGY78XHwyNYS48cS4b50SFEZTw4hOLq tT2rgF3AV1n+0TloFi11auxeXqR9/3mVtQtQS0AUvENgAIgzFFalQ5CIhOIIVC8cLXHOZleL381sL PdhYtQ1Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p8yqS-00FvQQ-7V; Sat, 24 Dec 2022 07:21:24 +0000 Date: Fri, 23 Dec 2022 23:21:24 -0800 From: Christoph Hellwig To: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= Cc: Christoph Hellwig , Andreas Gruenbacher , "Darrick J . Wong" , Alexander Viro , Matthew Wilcox , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com Subject: Re: [RFC v3 1/7] fs: Add folio_may_straddle_isize helper Message-ID: References: <20221216150626.670312-1-agruenba@redhat.com> <20221216150626.670312-2-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 23, 2022 at 11:04:51PM +0100, Andreas Gr?nbacher wrote: > > I find the naming very confusing. Any good reason to not follow > > the naming of pagecache_isize_extended an call it > > folio_isize_extended? > > A good reason for a different name is because > folio_may_straddle_isize() requires a locked folio, while > pagecache_isize_extended() will fail if the folio is still locked. So > this doesn't follow the usual "replace 'page' with 'folio'" pattern. pagecache also doesn't say page, it says pagecache. I'd still prepfer to keep the postfix the same. And I think the fact that it needs a locked folio should also have an assert, which both documents this and catches errors. I think that's much better than an arbitrarily different name. > > Should pagecache_isize_extended be rewritten to use this helper, > > i.e. turn this into a factoring out of a helper? > > I'm not really sure about that. The boundary conditions in the two > functions are not identical. I think the logic in > folio_may_straddle_isize() is sufficient for the > extending-write-under-folio-lock case, but I'd still need confirmation > for that. If the same logic would also be enough in > pagecache_isize_extended() is more unclear to me. That's another thing that really needs to into the commit log, why is the condition different and pagecache_isize_extended can't just be extended for it (if it really can't).