libnvdimm, pmem, pfn: make pmem_rw_bytes generic and refactor pfn setup
authorDan Williams <dan.j.williams@intel.com>
Tue, 22 Mar 2016 07:22:16 +0000 (00:22 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 22 Apr 2016 19:26:23 +0000 (12:26 -0700)
commit200c79da824c978fcf6eec1dc9c0a1e521133267
treebbc2182ead10eaa034278bb42c01a924db9a7d7d
parent947df02d255a6a81a3832e831c5ca02078cfd529
libnvdimm, pmem, pfn: make pmem_rw_bytes generic and refactor pfn setup

In preparation for providing an alternative (to block device) access
mechanism to persistent memory, convert pmem_rw_bytes() to
nsio_rw_bytes().  This allows ->rw_bytes() functionality without
requiring a 'struct pmem_device' to be instantiated.

In other words, when ->rw_bytes() is in use i/o is driven through
'struct nd_namespace_io', otherwise it is driven through 'struct
pmem_device' and the block layer.  This consolidates the disjoint calls
to devm_exit_badblocks() and devm_memunmap() into a common
devm_nsio_disable() and cleans up the init path to use a unified
pmem_attach_disk() implementation.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/blk.c
drivers/nvdimm/btt_devs.c
drivers/nvdimm/claim.c
drivers/nvdimm/nd.h
drivers/nvdimm/pfn_devs.c
drivers/nvdimm/pmem.c
include/linux/nd.h
tools/testing/nvdimm/Kbuild
tools/testing/nvdimm/test/iomap.c