diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2017-07-26 16:35:09 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-07-26 22:55:44 +0300 |
commit | 273752c9ff03eb83856601b2a3458218bb949e46 (patch) | |
tree | 2248ae6002c2deed099fcc0657c8665c2015d949 /drivers/dax | |
parent | 34c96507e8f6be497c15497be05f489fb34c5880 (diff) | |
download | linux-273752c9ff03eb83856601b2a3458218bb949e46.tar.xz |
dm, dax: Make sure dm_dax_flush() is called if device supports it
Currently dm_dax_flush() is not being called, even if underlying dax
device supports write cache, because DAXDEV_WRITE_CACHE is not being
propagated up to the DM dax device.
If the underlying dax device supports write cache, set
DAXDEV_WRITE_CACHE on the DM dax device. This will cause dm_dax_flush()
to be called.
Fixes: abebfbe2f7 ("dm: add ->flush() dax operation support")
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ce9e563e6e1d..938eb4868f7f 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -278,6 +278,12 @@ void dax_write_cache(struct dax_device *dax_dev, bool wc) } EXPORT_SYMBOL_GPL(dax_write_cache); +bool dax_write_cache_enabled(struct dax_device *dax_dev) +{ + return test_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags); +} +EXPORT_SYMBOL_GPL(dax_write_cache_enabled); + bool dax_alive(struct dax_device *dax_dev) { lockdep_assert_held(&dax_srcu); |