Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp307339pxb; Tue, 12 Apr 2022 02:24:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCzUVBzmnnKSb0P8gLYI9c5jus8G54WTQf5c7CJTxnOJ3bXBp0b8cz1yH2iJ4j0N5HBUqA X-Received: by 2002:a17:907:a42a:b0:6e7:f84b:bfa9 with SMTP id sg42-20020a170907a42a00b006e7f84bbfa9mr17406413ejc.656.1649755459230; Tue, 12 Apr 2022 02:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649755459; cv=none; d=google.com; s=arc-20160816; b=IFyLIEZ/oIXm3YtrX73dq7f8U4lp6npwSNDNaBYIcuDmxfu3+rp9HsftZcona5QA95 KXHLAgzEJ8Yw2MndlxXkce8ZIyqIATfDgHDCE94St9daWB3WujKI5cRlrNMw++rzxpRo 6TsJpeD2IYYiy8z1CsdNHgRCL7C0v/J6iqPMs3Vt44hsmwzPq8iXWG2UVVEuYPItJ1qy TVoCLH+0YVsCVPuU25NWcbX7xGTa9VXs3eXflu8h6b9SrML/sxchkFlrk3jf5TL0ZPtm LvK0PUsbONGQF/qbsYMV6qtzZT/muT5D2MKHBXK/3PAyaDOarNx2S+YBUyLEmUkLuLqR s3aQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xxpfJwOTp0zZ4mEFeo2bEwyNiH/HvBWSwa1t8TxoKCk=; b=i73ZW0YHLuCwEUFzg9Bt1PnArgihfFjcppR5qAT9Fz8j5qc8sm52gz9X9uLTimX1x9 9xR+fD1NTtkhzyFW+SepQ0fFNnKWGqI8jzPExWOqa0hdSu9wPhN1JMzU6eGtrNozR2+e 1iGSzsq805gm3KRSWxmYuX5Oe56cXDHmlMK5fFKuiyc1T4nfIIWhTu3+IajIAFo/789H /VJRcP8kzGCAifIbAt+PPkSmJnjQbPlVgC3XJ7sh0CGrIM2h1O+ddtGGUMdH7aL5fzWw bAP4PWtYkwPnZwAxunvfgNxjhqXiT+Ccv7eSW6NklXmQSm/uiQU57BsW1nsiMOuuHfct JZeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="1Bp/fmvI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 bg9-20020a170906a04900b006df76385e65si8119442ejb.773.2022.04.12.02.23.48; Tue, 12 Apr 2022 02:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="1Bp/fmvI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347393AbiDLFEq (ORCPT + 99 others); Tue, 12 Apr 2022 01:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbiDLFEn (ORCPT ); Tue, 12 Apr 2022 01:04:43 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA1A340C9; Mon, 11 Apr 2022 22:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xxpfJwOTp0zZ4mEFeo2bEwyNiH/HvBWSwa1t8TxoKCk=; b=1Bp/fmvIlZv8uA/4GoXEweJp/p jlJjY7tp9v1H/I5gwNEEO8e0bZ+Pz7kTlrArNY8Qe0bCZY5RqIYP42bATTDtDeCzwmjVWRpAoDz5c N1TuusZGVo27oRO9a9kJoTXp3442Y9BfyiVseUegOZXd81cxS7Ei/UsUe98Hysm3X1HJ9bHQnhjrf AXHrMIYfxlvEEO8dXxBI45I6AT6iOV5hybD+7tPANpKCYjrdiZ4KnB4YbFOjAE1hnmn4bwv63GFnP DnEVvUVr2iAriSepVlr/s9pY6Vlrw4MhRUdh/9HmyVWfHpc/9QkTixdWDnWm+iKqECdmpASOrXPVq /kHk02qQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne8fR-00Bjrs-9H; Tue, 12 Apr 2022 05:02:17 +0000 Date: Mon, 11 Apr 2022 22:02:17 -0700 From: Christoph Hellwig To: Dan Williams Cc: Jane Chu , david , "Darrick J. Wong" , Christoph Hellwig , Vishal L Verma , Dave Jiang , Alasdair Kergon , Mike Snitzer , device-mapper development , "Weiny, Ira" , Matthew Wilcox , Vivek Goyal , linux-fsdevel , Linux NVDIMM , Linux Kernel Mailing List , linux-xfs , X86 ML Subject: Re: [PATCH v7 4/6] dax: add DAX_RECOVERY flag and .recovery_write dev_pgmap_ops Message-ID: References: <20220405194747.2386619-1-jane.chu@oracle.com> <20220405194747.2386619-5-jane.chu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Mon, Apr 11, 2022 at 09:57:36PM -0700, Dan Williams wrote: > So how about change 'int flags' to 'enum dax_access_mode mode' where > dax_access_mode is: > > /** > * enum dax_access_mode - operational mode for dax_direct_access() > * @DAX_ACCESS: nominal access, fail / trim access on encountering poison > * @DAX_RECOVERY_WRITE: ignore poison and provide a pointer suitable > for use with dax_recovery_write() > */ > enum dax_access_mode { > DAX_ACCESS, > DAX_RECOVERY_WRITE, > }; > > Then the conversions look like this: > > - rc = dax_direct_access(iter->iomap.dax_dev, pgoff, 1, &kaddr, NULL); > + rc = dax_direct_access(iter->iomap.dax_dev, pgoff, 1, > DAX_ACCESS, &kaddr, NULL); > > ...and there's less chance of confusion with the @nr_pages argument. Yes, this might be a little nicer.