xfs: add ->pfn_mkwrite support for DAX
PATCH 1/1 xfs: add ->pfn_mkwrite support for DAX
From: Dave Chinner <[email protected]>
->pfn_mkwrite support is needed so that when a page with allocated backing store first takes a write fault the timestamps on the file are updated. THis fixes a generic/080 failure.
--- fs/xfs/xfs_file.c | 11 +++++++++++ fs/xfs/xfs_trace.h | 1 + 2 files changed, 12 insertions(+)
fs/xfs/xfs_file.c +11 -0
@@ -1546,10 +1546,21 @@ xfs_filemap_fault(return ret; } +static int +xfs_filemap_pfn_mkwrite ( +struct vm_area_struct *vma, +struct vm_fault *vmf) +{ +trace_xfs_filemap_pfn_mkwrite (XFS_I (file_inode (vma->vm_file))); + +return dax_pfn_mkwrite (vma, vmf); +} +static const struct vm_operations_struct xfs_file_vm_ops = { .fault = xfs_filemap_fault, .map_pages = filemap_map_pages, .page_mkwrite = xfs_filemap_page_mkwrite, + .pfn_mkwrite = xfs_filemap_pfn_mkwrite, };STATIC int
fs/xfs/xfs_trace.h +1 -0
@@ -688,6 +688,7 @@ DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);DEFINE_INODE_EVENT (xfs_filemap_fault);DEFINE_INODE_EVENT (xfs_filemap_page_mkwrite); +DEFINE_INODE_EVENT (xfs_filemap_pfn_mkwrite); DECLARE_EVENT_CLASS(xfs_iref_class, TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Dave Chinner
From: Dave Chinner <[email protected]>
->pfn_mkwrite support is needed so that when a page with allocated backing store first takes a write fault the timestamps on the file are updated. THis fixes a generic/080 failure.
Shouldn't you be able to drop the call to xfs_filemap_page_mkwrite from xfs_filemap_fault now?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Dave Chinner
From: Dave Chinner <[email protected]>
->pfn_mkwrite support is needed so that when a page with allocated backing store first takes a write fault the timestamps on the file are updated. THis fixes a generic/080 failure.
Shouldn't you be able to drop the call to
xfs_filemap_page_mkwritefromxfs_filemap_faultnow?
No idea. It hasn't been removed from dax_fault, so I'm not going to remove it from xfs_filemap_page_mkwrite()...
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Dave Chinner
From: Dave Chinner <[email protected]>
->pfn_mkwrite support is needed so that when a page with allocated backing store first takes a write fault the timestamps on the file are updated. THis fixes a generic/080 failure.
Signed-off-by Dave Chinner <[email protected]>
I made a patch for this yesterday, but yours is better of-course I feel guilty because I sent the patch for the pfn_mkwrite thing, at the time xfs-dax was not yet in, but I forgot all about it when reviewing the xfs-dax. My bad, sorry.
Thanks Dave
Boaz
Quoted 37 lines
--- fs/xfs/xfs_file.c | 11 +++++++++++ fs/xfs/xfs_trace.h | 1 + 2 files changed, 12 insertions(+)fs/xfs/xfs_file.c +11
-0@@ -1546,10 +1546,21 @@ xfs_filemap_fault(return ret; } +static int +xfs_filemap_pfn_mkwrite ( +struct vm_area_struct *vma, +struct vm_fault *vmf) +{ +trace_xfs_filemap_pfn_mkwrite (XFS_I (file_inode (vma->vm_file))); + +return dax_pfn_mkwrite (vma, vmf); +} +static const struct vm_operations_struct xfs_file_vm_ops = { .fault = xfs_filemap_fault, .map_pages = filemap_map_pages, .page_mkwrite = xfs_filemap_page_mkwrite, + .pfn_mkwrite = xfs_filemap_pfn_mkwrite, };STATIC intfs/xfs/xfs_trace.h +0
-0
fs/xfs/xfs_trace.h DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); · line 694
Quoted 7 lines
fs/xfs/xfs_trace.h +1
-0@@ -688,6 +688,7 @@ DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);DEFINE_INODE_EVENT (xfs_filemap_fault);DEFINE_INODE_EVENT (xfs_filemap_page_mkwrite); +DEFINE_INODE_EVENT (xfs_filemap_pfn_mkwrite); DECLARE_EVENT_CLASS(xfs_iref_class, TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs