Skip to content

Commit

Permalink
fix ksm.h breakage of nommu build
Browse files Browse the repository at this point in the history
Commit 5ad6468 "ksm: let shared pages
be swappable" breaks the build on m68knommu and I suspect on any nommu:

  In file included from kernel/fork.c:52:
  include/linux/ksm.h:129: warning: 'enum ttu_flags' declared inside parameter list
  include/linux/ksm.h:129: warning: its scope is only this definition or declaration, which is probably not what you want
  include/linux/ksm.h:129: error: parameter 2 ('flags') has incomplete type
  make[1]: *** [kernel/fork.o] Error 1
  make[1]: *** Waiting for unfinished jobs....

Let's fix that with CONFIG_MMU around most of the !CONFIG_KSM declarations.

Reported-by: Steven King <sfking@fdwdc.com>
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Tested-by: Steven King <sfking@fdwdc.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Dec 16, 2009
1 parent 8bea867 commit f42647a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/linux/ksm.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ void ksm_migrate_page(struct page *newpage, struct page *oldpage);

#else /* !CONFIG_KSM */

static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
unsigned long end, int advice, unsigned long *vm_flags)
{
return 0;
}

static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
{
return 0;
Expand All @@ -114,6 +108,13 @@ static inline int PageKsm(struct page *page)
return 0;
}

#ifdef CONFIG_MMU
static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
unsigned long end, int advice, unsigned long *vm_flags)
{
return 0;
}

static inline struct page *ksm_might_need_to_copy(struct page *page,
struct vm_area_struct *vma, unsigned long address)
{
Expand All @@ -140,6 +141,7 @@ static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*,
static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage)
{
}
#endif /* CONFIG_MMU */
#endif /* !CONFIG_KSM */

#endif /* __LINUX_KSM_H */

0 comments on commit f42647a

Please sign in to comment.