diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-08-10 19:27:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-10 19:40:56 -0400 |
commit | 3b33719c9b741066f7d2bc6036409752f8e0478d (patch) | |
tree | 292ce0ff8ea8a58f40b1ba120597fe22a32b719f | |
parent | a545de5ce2ef3abc4db0b9331840acf59c8f9efa (diff) |
thp: move shmem_huge_enabled() outside of SYSFS ifdef
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.
Fixes: e496cf3d7821 ("thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE")
Link: http://lkml.kernel.org/r/20160809123638.1357593-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/shmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, | |||
3975 | 3975 | ||
3976 | struct kobj_attribute shmem_enabled_attr = | 3976 | struct kobj_attribute shmem_enabled_attr = |
3977 | __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store); | 3977 | __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store); |
3978 | #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */ | ||
3978 | 3979 | ||
3980 | #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE | ||
3979 | bool shmem_huge_enabled(struct vm_area_struct *vma) | 3981 | bool shmem_huge_enabled(struct vm_area_struct *vma) |
3980 | { | 3982 | { |
3981 | struct inode *inode = file_inode(vma->vm_file); | 3983 | struct inode *inode = file_inode(vma->vm_file); |
@@ -4006,7 +4008,7 @@ bool shmem_huge_enabled(struct vm_area_struct *vma) | |||
4006 | return false; | 4008 | return false; |
4007 | } | 4009 | } |
4008 | } | 4010 | } |
4009 | #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE && CONFIG_SYSFS */ | 4011 | #endif /* CONFIG_TRANSPARENT_HUGE_PAGECACHE */ |
4010 | 4012 | ||
4011 | #else /* !CONFIG_SHMEM */ | 4013 | #else /* !CONFIG_SHMEM */ |
4012 | 4014 | ||