From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03BDD469E for ; Tue, 12 Apr 2022 05:02:28 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.