OSDN Git Service

device-dax: Enable page_mapping()
authorDan Williams <dan.j.williams@intel.com>
Sat, 14 Jul 2018 04:49:40 +0000 (21:49 -0700)
committerDave Jiang <dave.jiang@intel.com>
Fri, 20 Jul 2018 18:20:13 +0000 (11:20 -0700)
commit2232c6382a453db73d2e723df1b52030066e135e
tree2bf5466b3248ef03ff47099e8247753ff2029368
parent226ab561075f6f8f3cd5f7b3b7544f3997aab51f
device-dax: Enable page_mapping()

In support of enabling memory_failure() handling for device-dax
mappings, set the ->mapping association of pages backing device-dax
mappings. The rmap implementation requires page_mapping() to return the
address_space hosting the vmas that map the page.

The ->mapping pointer is never cleared. There is no possibility for the
page to become associated with another address_space while the device is
enabled. When the device is disabled the 'struct page' array for the
device is destroyed / later reinitialized to zero.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/dax/device.c