Skip to contentSkip to conversation

ext2/4, xfs: call thp_get_unmapped_area() for pmd mappings

PATCH New [email protected] 1 participant 1 message Oct 8, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 63/127 ext2/4, xfs: call thp_get_unmapped_area() for pmd mappings

From: Toshi Kani <[email protected]>
Subject: ext2/4, xfs: call thp_get_unmapped_area() for pmd mappings

To support DAX pmd mappings with unmodified applications, filesystems need to align an mmap address by the pmd size.

Call thp_get_unmapped_area() from f_op->get_unmapped_area.

Note, there is no change in behavior for a non-DAX file.

Cc Dan Williams <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Dave Chinner <[email protected]>
Cc Jan Kara <[email protected]>
Cc Theodore Ts'o <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Hugh Dickins <[email protected]>

---

 fs/ext2/file.c    |    1 +
 fs/ext4/file.c    |    1 +
 fs/xfs/xfs_file.c |    1 +
 3 files changed, 3 insertions(+)
fs/ext2/file.c renamed from fs/ext2/file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings +1 -0
diff -puN fs/ext2/file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings fs/ext2/file.c
@@ -234,6 +234,7 @@ const struct file_operations ext2_file_o
 	.open		= dquot_file_open,
 	.release	= ext2_release_file,
 	.fsync		= ext2_fsync,
+	.get_unmapped_area = thp_get_unmapped_area,
 	.splice_read	= generic_file_splice_read,
 	.splice_write	= iter_file_splice_write,
 };
fs/ext4/file.c renamed from fs/ext4/file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings +1 -0
diff -puN fs/ext4/file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings fs/ext4/file.c
@@ -703,6 +703,7 @@ const struct file_operations ext4_file_o
 	.open		= ext4_file_open,
 	.release	= ext4_release_file,
 	.fsync		= ext4_sync_file,
+	.get_unmapped_area = thp_get_unmapped_area,
 	.splice_read	= generic_file_splice_read,
 	.splice_write	= iter_file_splice_write,
 	.fallocate	= ext4_fallocate,
fs/xfs/xfs_file.c renamed from fs/xfs/xfs_file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings +1 -0
diff -puN fs/xfs/xfs_file.c~ext2-4-xfs-call-thp_get_unmapped_area-for-pmd-mappings fs/xfs/xfs_file.c
@@ -1618,6 +1618,7 @@ const struct file_operations xfs_file_op
 	.open		= xfs_file_open,
 	.release	= xfs_file_release,
 	.fsync		= xfs_file_fsync,
+	.get_unmapped_area = thp_get_unmapped_area,
 	.fallocate	= xfs_file_fallocate,
 };
 

_