memremap: change devm_memremap_pages interface to use struct dev_pagemap
authorChristoph Hellwig <hch@lst.de>
Fri, 29 Dec 2017 07:54:05 +0000 (08:54 +0100)
committerDan Williams <dan.j.williams@intel.com>
Mon, 8 Jan 2018 19:46:23 +0000 (11:46 -0800)
commite8d5134833006a46fcbefc5f4a84d0b62bd520e7
treedbd532f4ef91828e251a291c967ee3afe71fd475
parente7744aa25cffe26d3767c9ffcf4e130cca1dff00
memremap: change devm_memremap_pages interface to use struct dev_pagemap

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 <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dax/pmem.c
drivers/nvdimm/nd.h
drivers/nvdimm/pfn_devs.c
drivers/nvdimm/pmem.c
drivers/nvdimm/pmem.h
include/linux/memremap.h
kernel/memremap.c
tools/testing/nvdimm/test/iomap.c