diff options
author | Brian Behlendorf <[email protected]> | 2009-05-20 14:23:13 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-05-20 14:23:13 -0700 |
commit | 5232d256b45b3c48dd96d30b5907c0205192197b (patch) | |
tree | 82f3341f62d1e0d49c42fb1b4f3cd40e66515c7a /module/spl/spl-kmem.c | |
parent | 3731931529df2bff63ca3d62e387d4e602de7cb2 (diff) |
SLES10 Fixes (part 6)
- Prior to 2.6.17 there were no *_pgdat helper functions in mm/mmzone.c.
Instead for_each_zone() operated directly on pgdat_list which may or
may not have been exported depending on how your kernel was compiled.
Now new configure checks determine if you have the helpers or not, and
if the needed symbols are exported. If they are not exported then they
are dynamically aquired at runtime by kallsyms_lookup_name().
Diffstat (limited to 'module/spl/spl-kmem.c')
-rw-r--r-- | module/spl/spl-kmem.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 706691929..4009aa3b2 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -84,20 +84,30 @@ get_vmalloc_info_t get_vmalloc_info_fn = SYMBOL_POISON; EXPORT_SYMBOL(get_vmalloc_info_fn); #endif /* HAVE_GET_VMALLOC_INFO */ -#ifndef HAVE_FIRST_ONLINE_PGDAT +#ifdef HAVE_PGDAT_HELPERS +# ifndef HAVE_FIRST_ONLINE_PGDAT first_online_pgdat_t first_online_pgdat_fn = SYMBOL_POISON; EXPORT_SYMBOL(first_online_pgdat_fn); -#endif /* HAVE_FIRST_ONLINE_PGDAT */ +# endif /* HAVE_FIRST_ONLINE_PGDAT */ -#ifndef HAVE_NEXT_ONLINE_PGDAT +# ifndef HAVE_NEXT_ONLINE_PGDAT next_online_pgdat_t next_online_pgdat_fn = SYMBOL_POISON; EXPORT_SYMBOL(next_online_pgdat_fn); -#endif /* HAVE_NEXT_ONLINE_PGDAT */ +# endif /* HAVE_NEXT_ONLINE_PGDAT */ -#ifndef HAVE_NEXT_ZONE +# ifndef HAVE_NEXT_ZONE next_zone_t next_zone_fn = SYMBOL_POISON; EXPORT_SYMBOL(next_zone_fn); -#endif /* HAVE_NEXT_ZONE */ +# endif /* HAVE_NEXT_ZONE */ + +#else /* HAVE_PGDAT_HELPERS */ + +# ifndef HAVE_PGDAT_LIST +struct pglist_data *pgdat_list_addr = SYMBOL_POISON; +EXPORT_SYMBOL(pgdat_list_addr); +# endif /* HAVE_PGDAT_LIST */ + +#endif /* HAVE_PGDAT_HELPERS */ #ifndef HAVE_ZONE_STAT_ITEM_FIA # ifndef HAVE_GET_ZONE_COUNTS @@ -1806,32 +1816,45 @@ spl_kmem_init_kallsyms_lookup(void) } #endif /* HAVE_GET_VMALLOC_INFO */ -#ifndef HAVE_FIRST_ONLINE_PGDAT +#ifdef HAVE_PGDAT_HELPERS +# ifndef HAVE_FIRST_ONLINE_PGDAT first_online_pgdat_fn = (first_online_pgdat_t) spl_kallsyms_lookup_name("first_online_pgdat"); if (!first_online_pgdat_fn) { printk(KERN_ERR "Error: Unknown symbol first_online_pgdat\n"); return -EFAULT; } -#endif /* HAVE_FIRST_ONLINE_PGDAT */ +# endif /* HAVE_FIRST_ONLINE_PGDAT */ -#ifndef HAVE_NEXT_ONLINE_PGDAT +# ifndef HAVE_NEXT_ONLINE_PGDAT next_online_pgdat_fn = (next_online_pgdat_t) spl_kallsyms_lookup_name("next_online_pgdat"); if (!next_online_pgdat_fn) { printk(KERN_ERR "Error: Unknown symbol next_online_pgdat\n"); return -EFAULT; } -#endif /* HAVE_NEXT_ONLINE_PGDAT */ +# endif /* HAVE_NEXT_ONLINE_PGDAT */ -#ifndef HAVE_NEXT_ZONE +# ifndef HAVE_NEXT_ZONE next_zone_fn = (next_zone_t) spl_kallsyms_lookup_name("next_zone"); if (!next_zone_fn) { printk(KERN_ERR "Error: Unknown symbol next_zone\n"); return -EFAULT; } -#endif /* HAVE_NEXT_ZONE */ +# endif /* HAVE_NEXT_ZONE */ + +#else /* HAVE_PGDAT_HELPERS */ + +# ifndef HAVE_PGDAT_LIST + pgdat_list_addr = (struct pglist_data *) + spl_kallsyms_lookup_name("pgdat_list"); + if (!pgdat_list_addr) { + printk(KERN_ERR "Error: Unknown symbol pgdat_list\n"); + return -EFAULT; + } +# endif /* HAVE_PGDAT_LIST */ +#endif /* HAVE_PGDAT_HELPERS */ #ifndef HAVE_ZONE_STAT_ITEM_FIA # ifndef HAVE_GET_ZONE_COUNTS |