From patchwork Thu Apr 14 16:48:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kani, Toshi" X-Patchwork-Id: 8839691 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A7534C0553 for ; Thu, 14 Apr 2016 16:57:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD7D7202DD for ; Thu, 14 Apr 2016 16:57:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE667202A1 for ; Thu, 14 Apr 2016 16:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754868AbcDNQ5a (ORCPT ); Thu, 14 Apr 2016 12:57:30 -0400 Received: from g1t5425.austin.hp.com ([15.216.225.55]:39475 "EHLO g1t5425.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030232AbcDNQ51 (ORCPT ); Thu, 14 Apr 2016 12:57:27 -0400 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g1t5425.austin.hp.com (Postfix) with ESMTP id F17EC50; Thu, 14 Apr 2016 16:57:14 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.78.168.61]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id E026A3A; Thu, 14 Apr 2016 16:57:13 +0000 (UTC) From: Toshi Kani To: akpm@linux-foundation.org, dan.j.williams@intel.com, viro@zeniv.linux.org.uk Cc: willy@linux.intel.com, ross.zwisler@linux.intel.com, kirill.shutemov@linux.intel.com, david@fromorbit.com, jack@suse.cz, tytso@mit.edu, adilger.kernel@dilger.ca, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Toshi Kani Subject: [PATCH v3 2/2] ext2/4, xfs, blk: call dax_get_unmapped_area() for DAX pmd mappings Date: Thu, 14 Apr 2016 10:48:31 -0600 Message-Id: <1460652511-19636-3-git-send-email-toshi.kani@hpe.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460652511-19636-1-git-send-email-toshi.kani@hpe.com> References: <1460652511-19636-1-git-send-email-toshi.kani@hpe.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To support DAX pmd mappings with unmodified applications, filesystems need to align an mmap address by the pmd size. Call dax_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 Cc: Andrew Morton Cc: Alexander Viro Cc: Dan Williams Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Kirill A. Shutemov Cc: Dave Chinner Cc: Jan Kara Cc: Theodore Ts'o Cc: Andreas Dilger --- 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/block_dev.c b/fs/block_dev.c index 20a2c02..52518e0 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 = dax_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..dbf11eb 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 = dax_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..6c268f8 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 = dax_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..1e409a6 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 = dax_get_unmapped_area, .fallocate = xfs_file_fallocate, };