]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
filesystem-dax: convert to dax_flush()
authorDan Williams <dan.j.williams@intel.com>
Mon, 29 May 2017 20:07:46 +0000 (13:07 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 15 Jun 2017 21:35:24 +0000 (14:35 -0700)
Filesystem-DAX flushes caches whenever it writes to the address returned
through dax_direct_access() and when writing back dirty radix entries.
That flushing is only required in the pmem case, so the dax_flush()
helper skips cache management work when the underlying driver does not
specify a flush method.

We still do all the dirty tracking since the radix entry will already be
there for locking purposes. However, the work to clean the entry will be
a nop for some dax drivers.

Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c

index b459948de42776b9dcf1e270fc84e6273df59a2b..0933fc460ada050ad018d75329d31c0b1a71e069 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -784,7 +784,7 @@ static int dax_writeback_one(struct block_device *bdev,
        }
 
        dax_mapping_entry_mkclean(mapping, index, pfn_t_to_pfn(pfn));
-       wb_cache_pmem(kaddr, size);
+       dax_flush(dax_dev, pgoff, kaddr, size);
        /*
         * After we have flushed the cache, we can clear the dirty tag. There
         * cannot be new dirty data in the pfn after the flush has completed as