From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbdLSPDv (ORCPT ); Tue, 19 Dec 2017 10:03:51 -0500 Received: from verein.lst.de ([213.95.11.211]:38741 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477AbdLSPDt (ORCPT ); Tue, 19 Dec 2017 10:03:49 -0500 Date: Tue, 19 Dec 2017 16:03:47 +0100 From: Christoph Hellwig To: Dan Williams Cc: Christoph Hellwig , =?iso-8859-1?B?Suly9G1l?= Glisse , Logan Gunthorpe , "linux-nvdimm@lists.01.org" , linuxppc-dev , X86 ML , Linux MM , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 16/17] memremap: change devm_memremap_pages interface to use struct dev_pagemap Message-ID: <20171219150347.GC13124@lst.de> References: <20171215140947.26075-1-hch@lst.de> <20171215140947.26075-17-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 17, 2017 at 10:51:56AM -0800, Dan Williams wrote: > On Fri, Dec 15, 2017 at 6:09 AM, Christoph Hellwig wrote: > > From: Logan Gunthorpe > > > > This new interface is similar to how struct device (and many others) > > work. The caller initializes a 'struct dev_pagemap' as required > > and calls 'devm_memremap_pages'. This allows the pagemap structure to > > be embedded in another structure and thus container_of can be used. In > > this way application specific members can be stored in a containing > > struct. > > > > This will be used by the P2P infrastructure and HMM could probably > > be cleaned up to use it as well (instead of having it's own, similar > > 'hmm_devmem_pages_create' function). > > > > Signed-off-by: Logan Gunthorpe > > Signed-off-by: Christoph Hellwig > > Looks good, I notice that this does not initialize pgmap->type to > MEMORY_DEVICE_HOST, but since that value is zero and likely won't > change we're ok. I'll add it jut for clarity.