From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by kanga.kvack.org (Postfix) with ESMTP id 995806B025F for ; Tue, 19 Dec 2017 10:03:49 -0500 (EST) Received: by mail-wr0-f197.google.com with SMTP id t92so11549626wrc.13 for ; Tue, 19 Dec 2017 07:03:49 -0800 (PST) Received: from newverein.lst.de (verein.lst.de. [213.95.11.211]) by mx.google.com with ESMTPS id d18si1587727wme.183.2017.12.19.07.03.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 07:03:48 -0800 (PST) Date: Tue, 19 Dec 2017 16:03:47 +0100 From: Christoph Hellwig 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: Sender: owner-linux-mm@kvack.org List-ID: 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" 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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org