[dm-devel] [PATCH] dm, dax: Make sure dm_dax_flush() is called if device supports it
Dan Williams
dan.j.williams at intel.com
Tue Jul 25 20:43:27 UTC 2017
On Tue, Jul 25, 2017 at 12:43 PM, Vivek Goyal <vgoyal at redhat.com> wrote:
> Right now, dm_dax_flush() is not being called and I think it is not being
> called becuase DAXDEV_WRITE_CACHE is not set on dm dax device.
>
> If underlying dax device supports write cache, set DAXDEV_WRITE_CACHE on
> dm dax device. This will get dm_dax_flush() being called.
>
> Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
> ---
> drivers/dax/super.c | 5 +++++
> drivers/md/dm-table.c | 33 +++++++++++++++++++++++++++++++++
> include/linux/dax.h | 1 +
> 3 files changed, 39 insertions(+)
>
> diff --git a/drivers/dax/super.c b/drivers/dax/super.c
> index ce9e563e6e1d..5c5e7b9f6831 100644
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c
> @@ -278,6 +278,11 @@ 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);
> +}
We need :
EXPORT_SYMBOL_GPL(dax_write_cache_enabled)
...but other than that, looks good to me.
Acked-by: Dan Williams <dan.j.williams at intel.com>
More information about the dm-devel
mailing list