From: William Kucharski Date: Sun, 22 Sep 2019 12:43:15 +0000 (-0400) Subject: mm/readahead: Align file mappings for non-DAX X-Git-Tag: v5.18-rc1~167^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1854bc6e2420;p=thirdparty%2Flinux.git mm/readahead: Align file mappings for non-DAX When we have the opportunity to use PMDs to map a file, we want to follow the same rules as DAX. Signed-off-by: William Kucharski Signed-off-by: Matthew Wilcox (Oracle) --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 38e233a7d9776..f85b04b31bd12 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -582,13 +582,10 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long ret; loff_t off = (loff_t)pgoff << PAGE_SHIFT; - if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD)) - goto out; - ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE); if (ret) return ret; -out: + return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); } EXPORT_SYMBOL_GPL(thp_get_unmapped_area);