diff options
author | Dan Williams <dan.j.williams@intel.com> | 2020-04-02 19:55:17 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2020-04-02 19:55:17 -0700 |
commit | f6d2b802f80d0ca89ee1f51c1781b3f79cdb25d5 (patch) | |
tree | fe4dfcaafe847b71ebd040f348c0a2ee8206b38a /drivers/md/dm-linear.c | |
parent | d3b88655c0a157c11370b8faf50e82ecb1c17d54 (diff) | |
parent | 4e4ced93794acb42adb19484132966defba8f3a6 (diff) | |
download | linux-stable-f6d2b802f80d0ca89ee1f51c1781b3f79cdb25d5.tar.gz linux-stable-f6d2b802f80d0ca89ee1f51c1781b3f79cdb25d5.tar.bz2 linux-stable-f6d2b802f80d0ca89ee1f51c1781b3f79cdb25d5.zip |
Merge branch 'for-5.7/libnvdimm' into libnvdimm-for-next
- Introduce 'zero_page_range' as a dax operation. This facilitates
filesystem-dax operation without a block-device.
- Advertise a persistence-domain for of_pmem and papr_scm. The
persistence domain indicates where cpu-store cycles need to reach in
the platform-memory subsystem before the platform will consider them
power-fail protected.
- Fixup some flexible-array declarations.
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r-- | drivers/md/dm-linear.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 8d07fdf63a47..e1db43446327 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -201,10 +201,27 @@ static size_t linear_dax_copy_to_iter(struct dm_target *ti, pgoff_t pgoff, return dax_copy_to_iter(dax_dev, pgoff, addr, bytes, i); } +static int linear_dax_zero_page_range(struct dm_target *ti, pgoff_t pgoff, + size_t nr_pages) +{ + int ret; + struct linear_c *lc = ti->private; + struct block_device *bdev = lc->dev->bdev; + struct dax_device *dax_dev = lc->dev->dax_dev; + sector_t dev_sector, sector = pgoff * PAGE_SECTORS; + + dev_sector = linear_map_sector(ti, sector); + ret = bdev_dax_pgoff(bdev, dev_sector, nr_pages << PAGE_SHIFT, &pgoff); + if (ret) + return ret; + return dax_zero_page_range(dax_dev, pgoff, nr_pages); +} + #else #define linear_dax_direct_access NULL #define linear_dax_copy_from_iter NULL #define linear_dax_copy_to_iter NULL +#define linear_dax_zero_page_range NULL #endif static struct target_type linear_target = { @@ -226,6 +243,7 @@ static struct target_type linear_target = { .direct_access = linear_dax_direct_access, .dax_copy_from_iter = linear_dax_copy_from_iter, .dax_copy_to_iter = linear_dax_copy_to_iter, + .dax_zero_page_range = linear_dax_zero_page_range, }; int __init dm_linear_init(void) |