提交 91a90140 编写于 作者: G Geert Uytterhoeven 提交者: Linus Torvalds

mm/memory.c: mark create_huge_pmd() inline to prevent build failure

With gcc 4.1.2:

    mm/memory.o: In function `create_huge_pmd':
    memory.c:(.text+0x93e): undefined reference to `do_huge_pmd_anonymous_page'

Interestingly, create_huge_pmd() is emitted in the assembler output, but
never called.

Converting transparent_hugepage_enabled() from a macro to a static
inline function reduced the ability of the compiler to remove unused
code.

Fix this by marking create_huge_pmd() inline.

Fixes: 16981d76 ("mm: improve readability of transparent_hugepage_enabled()")
Link: http://lkml.kernel.org/r/1499842660-10665-1-git-send-email-geert@linux-m68k.orgSigned-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c7acec71
...@@ -3591,7 +3591,7 @@ static int do_numa_page(struct vm_fault *vmf) ...@@ -3591,7 +3591,7 @@ static int do_numa_page(struct vm_fault *vmf)
return 0; return 0;
} }
static int create_huge_pmd(struct vm_fault *vmf) static inline int create_huge_pmd(struct vm_fault *vmf)
{ {
if (vma_is_anonymous(vmf->vma)) if (vma_is_anonymous(vmf->vma))
return do_huge_pmd_anonymous_page(vmf); return do_huge_pmd_anonymous_page(vmf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册