On Thu, Jul 27, 2017 at 03:12:40PM +0200, Jan Kara wrote:
Add 'sync' argument to dax_iomap_fault(). It will be used to
the fact that synchronous fault is requested.
I don't actually think you need to pass this 'sync' parameter around. I
you can completely rely on IOMAP_F_NEEDSYNC being set in iomap.flags. The DAX
fault handlers can call ops->iomap_begin() and use that flag for all the
tests and make it our once source of truth.
That flag also tells us that we are doing a write fault (from
if ((flags & IOMAP_FAULT) && (flags & IOMAP_WRITE) &&
iomap->flags |= IOMAP_F_NEEDDSYNC;
So conditionals like this from dax_iomap_pte_fault():
force_ro = (vmf->flags & FAULT_FLAG_WRITE) && sync &&
(iomap.flags & IOMAP_F_NEEDDSYNC);
can be simplified to:
force_ro = (iomap.flags & IOMAP_F_NEEDDSYNC);