浏览代码

mm: declare mpol_to_str() when CONFIG_TMPFS=n

When CONFIG_TMPFS=n mpol_to_str() is not declared in mempolicy.h.
However, in the NUMA case, the definition is always compiled.

Since it is not strictly true that tmpfs is the only client, and since the
symbol was always lurking around anyways, export mpol_to_str()
unconditionally.  Furthermore, this will allow us to move show_numa_map()
out of mempolicy.c and into the procfs subsystem.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stephen Wilson 14 年之前
父节点
当前提交
13057efb0a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      include/linux/mempolicy.h

+ 2 - 2
include/linux/mempolicy.h

@@ -231,10 +231,10 @@ int do_migrate_pages(struct mm_struct *mm,
 
 
 #ifdef CONFIG_TMPFS
 #ifdef CONFIG_TMPFS
 extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context);
 extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context);
+#endif
 
 
 extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 			int no_context);
 			int no_context);
-#endif
 
 
 /* Check if a vma is migratable */
 /* Check if a vma is migratable */
 static inline int vma_migratable(struct vm_area_struct *vma)
 static inline int vma_migratable(struct vm_area_struct *vma)
@@ -371,13 +371,13 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol,
 {
 {
 	return 1;	/* error */
 	return 1;	/* error */
 }
 }
+#endif
 
 
 static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 				int no_context)
 				int no_context)
 {
 {
 	return 0;
 	return 0;
 }
 }
-#endif
 
 
 #endif /* CONFIG_NUMA */
 #endif /* CONFIG_NUMA */
 #endif /* __KERNEL__ */
 #endif /* __KERNEL__ */