From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3z1LlC0Xk5zF06W for ; Wed, 20 Dec 2017 02:03:51 +1100 (AEDT) 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 In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.