[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1461370883-7664-3-git-send-email-toshi.kani@hpe.com>
Date: Fri, 22 Apr 2016 18:21:23 -0600
From: Toshi Kani <toshi.kani@....com>
To: akpm@...ux-foundation.org
Cc: dan.j.williams@...el.com, viro@...iv.linux.org.uk,
willy@...ux.intel.com, ross.zwisler@...ux.intel.com,
kirill.shutemov@...ux.intel.com, david@...morbit.com, jack@...e.cz,
tytso@....edu, adilger.kernel@...ger.ca, mike.kravetz@...cle.com,
toshi.kani@....com, linux-nvdimm@...ts.01.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 2/2] ext2/4, xfs, blk: 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.
Signed-off-by: Toshi Kani <toshi.kani@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Matthew Wilcox <willy@...ux.intel.com>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Cc: Dave Chinner <david@...morbit.com>
Cc: Jan Kara <jack@...e.cz>
Cc: Theodore Ts'o <tytso@....edu>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>
Cc: Mike Kravetz <mike.kravetz@...cle.com>
---
fs/block_dev.c | 1 +
fs/ext2/file.c | 1 +
fs/ext4/file.c | 1 +
fs/xfs/xfs_file.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 20a2c02..a4aa26d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1798,6 +1798,7 @@ const struct file_operations def_blk_fops = {
.write_iter = blkdev_write_iter,
.mmap = blkdev_mmap,
.fsync = blkdev_fsync,
+ .get_unmapped_area = thp_get_unmapped_area,
.unlocked_ioctl = block_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = compat_blkdev_ioctl,
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index c1400b1..92209a1 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -172,6 +172,7 @@ const struct file_operations ext2_file_operations = {
.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,
};
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index fa2208b..ceb8279 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -708,6 +708,7 @@ const struct file_operations ext4_file_operations = {
.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,
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 569938a..0225927 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1708,6 +1708,7 @@ const struct file_operations xfs_file_operations = {
.open = xfs_file_open,
.release = xfs_file_release,
.fsync = xfs_file_fsync,
+ .get_unmapped_area = thp_get_unmapped_area,
.fallocate = xfs_file_fallocate,
};
Powered by blists - more mailing lists