* [PATCH] thp: move shmem_huge_enabled() outside of SYSFS ifdef
@ 2016-08-09 12:36 Arnd Bergmann
2016-08-09 16:30 ` Kirill A. Shutemov
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-08-09 12:36 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, Hugh Dickins, Al Viro, Kirill A. Shutemov,
Vlastimil Babka, linux-mm, linux-kernel
The newly introduced shmem_huge_enabled() function has two definitions,
but neither of them is visible if CONFIG_SYSFS is disabled, leading
to a build error:
mm/khugepaged.o: In function `khugepaged':
khugepaged.c:(.text.khugepaged+0x3ca): undefined reference to `shmem_huge_enabled'
This changes the #ifdef guards around the definition to match those that
are used in the header file.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: e496cf3d7821 ("thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE")
---
mm/shmem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 7f7748a0f9e1..fd8b2b5741b1 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3975,7 +3975,9 @@ static ssize_t shmem_enabled_store(struct kobject *kobj,
struct kobj_attribute shmem_enabled_attr =
__ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store);
+#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */
+#ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
bool shmem_huge_enabled(struct vm_area_struct *vma)
{
struct inode *inode = file_inode(vma->vm_file);
@@ -4006,7 +4008,7 @@ bool shmem_huge_enabled(struct vm_area_struct *vma)
return false;
}
}
-#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */
+#endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE */
#else /* !CONFIG_SHMEM */
--
2.9.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thp: move shmem_huge_enabled() outside of SYSFS ifdef
2016-08-09 12:36 [PATCH] thp: move shmem_huge_enabled() outside of SYSFS ifdef Arnd Bergmann
@ 2016-08-09 16:30 ` Kirill A. Shutemov
0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2016-08-09 16:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, Hugh Dickins, Al Viro, Kirill A. Shutemov,
Vlastimil Babka, linux-mm, linux-kernel
On Tue, Aug 09, 2016 at 02:36:02PM +0200, Arnd Bergmann wrote:
> The newly introduced shmem_huge_enabled() function has two definitions,
> but neither of them is visible if CONFIG_SYSFS is disabled, leading
> to a build error:
>
> mm/khugepaged.o: In function `khugepaged':
> khugepaged.c:(.text.khugepaged+0x3ca): undefined reference to `shmem_huge_enabled'
>
> This changes the #ifdef guards around the definition to match those that
> are used in the header file.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: e496cf3d7821 ("thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE")
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-09 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09 12:36 [PATCH] thp: move shmem_huge_enabled() outside of SYSFS ifdef Arnd Bergmann
2016-08-09 16:30 ` Kirill A. Shutemov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).