diff options
author | Dan Williams <dan.j.williams@intel.com> | 2018-06-08 15:16:44 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-06-08 15:16:44 -0700 |
commit | 930218affeadd1325ea17e053f0dcecf218f5a4f (patch) | |
tree | 203c293668a88e03b9f292cf4d5a294ca8a4275a /drivers/md/dm-log-writes.c | |
parent | b56845794e1e93121acb74ca325db965035d5545 (diff) | |
parent | 5d8beee20d89e34ff1dcb0da84adf7607858c59d (diff) | |
download | blackbird-obmc-linux-930218affeadd1325ea17e053f0dcecf218f5a4f.tar.gz blackbird-obmc-linux-930218affeadd1325ea17e053f0dcecf218f5a4f.zip |
Merge branch 'for-4.18/mcsafe' into libnvdimm-for-next
Diffstat (limited to 'drivers/md/dm-log-writes.c')
-rw-r--r-- | drivers/md/dm-log-writes.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index c90c7c08a77f..9ea2b0291f20 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -962,9 +962,23 @@ static size_t log_writes_dax_copy_from_iter(struct dm_target *ti, dax_copy: return dax_copy_from_iter(lc->dev->dax_dev, pgoff, addr, bytes, i); } + +static size_t log_writes_dax_copy_to_iter(struct dm_target *ti, + pgoff_t pgoff, void *addr, size_t bytes, + struct iov_iter *i) +{ + struct log_writes_c *lc = ti->private; + sector_t sector = pgoff * PAGE_SECTORS; + + if (bdev_dax_pgoff(lc->dev->bdev, sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + return 0; + return dax_copy_to_iter(lc->dev->dax_dev, pgoff, addr, bytes, i); +} + #else #define log_writes_dax_direct_access NULL #define log_writes_dax_copy_from_iter NULL +#define log_writes_dax_copy_to_iter NULL #endif static struct target_type log_writes_target = { @@ -982,6 +996,7 @@ static struct target_type log_writes_target = { .io_hints = log_writes_io_hints, .direct_access = log_writes_dax_direct_access, .dax_copy_from_iter = log_writes_dax_copy_from_iter, + .dax_copy_to_iter = log_writes_dax_copy_to_iter, }; static int __init dm_log_writes_init(void) |