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 D6FDCEB64DD for ; Thu, 20 Jul 2023 13:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbjGTNZ0 (ORCPT ); Thu, 20 Jul 2023 09:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbjGTNZZ (ORCPT ); Thu, 20 Jul 2023 09:25:25 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94E110F5; Thu, 20 Jul 2023 06:25:22 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id C61476732D; Thu, 20 Jul 2023 15:25:18 +0200 (CEST) Date: Thu, 20 Jul 2023 15:25:18 +0200 From: Christoph Hellwig To: David Sterba Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Matthew Wilcox , linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 01/23] btrfs: pass a flags argument to cow_file_range Message-ID: <20230720132518.GA14692@lst.de> References: <20230628153144.22834-1-hch@lst.de> <20230628153144.22834-2-hch@lst.de> <20230720112236.GW20457@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230720112236.GW20457@twin.jikos.cz> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jul 20, 2023 at 01:22:36PM +0200, David Sterba wrote: > On Wed, Jun 28, 2023 at 05:31:22PM +0200, Christoph Hellwig wrote: > > The int used as bool unlock is not a very good way to describe the > > behavior, and the next patch will have to add another beahvior modifier. > > Switch to pass a flag instead, with an inital CFR_KEEP_LOCKED flag that > > specifies the pages should always be kept locked. This is the inverse > > of the old unlock argument for the reason that it requires a flag for > > the exceptional behavior. > > Int is the wrong type but I'm not sure that for two flags we should use > a bit flags. Two bool parameters are IMHO fine and "CFR" does not mean > anything, it's really only relevant for the function. CFR stands for cow_file_range. The good news is that with my (huge) stack of pending pages both flags will eventually go away. The bad news is that for an intermediate change I actually need a third one.