[PATCH] ia64: pfn_to_nid() implementation
authorBob Picco <bob.picco@hp.com>
Wed, 22 Jun 2005 00:15:05 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 22 Jun 2005 01:46:19 +0000 (18:46 -0700)
pfn_to_nid is undefined.  We haven't had this interface on ia64.  The
sys_mbind patches need it.

Oh, the paddr_to_nid call could fail when DISCONTIG+NUMA is configured
because there isn't any ACPI SRAT NUMA information.

Signed-off-by: Bob Picco <bob.picco@hp.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-ia64/mmzone.h

index 9491dacc89cfe0d21fec7adbb471b30d6f4bcde1..83ca4043fc1158076965dfaeae8e782da7f92292 100644 (file)
 #include <asm/page.h>
 #include <asm/meminit.h>
 
+static inline int pfn_to_nid(unsigned long pfn)
+{
+#ifdef CONFIG_NUMA
+       extern int paddr_to_nid(unsigned long);
+       int nid = paddr_to_nid(pfn << PAGE_SHIFT);
+       if (nid < 0)
+               return 0;
+       else
+               return nid;
+#else
+       return 0;
+#endif
+}
+
 #ifdef CONFIG_DISCONTIGMEM
 
 #ifdef CONFIG_IA64_DIG /* DIG systems are small */