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 434CBC433FE for ; Tue, 12 Apr 2022 05:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243867AbiDLFEo (ORCPT ); Tue, 12 Apr 2022 01:04:44 -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 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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.