summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-kmem.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-05-20 10:08:37 -0700
committerBrian Behlendorf <[email protected]>2009-05-20 10:08:37 -0700
commit96dded38442684319305082aa2ac7e25f7f414da (patch)
treea541f01e4f60b05adb9931088c2080f659003786 /module/spl/spl-kmem.c
parentbf338d8d09b410884be526ed4f11b6030244dbfa (diff)
SLES10 Fixes (part 2):
- Configure check, the div64_64() function was renamed to div64_u64() as of 2.6.26. - Configure check, the global_page_state() fuction was introduced in 2.6.18 kernels. The earlier 2.6.16 based SLES10 must not try and use it, thankfully get_zone_counts() is still available. - To simplify debugging poison all symbols aquired dynamically using spl_kallsyms_lookup_name() with SYMBOL_POISON. - Add console messages when the user mode helpers fail. - spl_kmem_init_globals() use bit shifts instead of division. - When the monotonic clock is unavailable __gethrtime() must perform the HZ division as an 'unsigned long long' because the SPL only implements __udivdi3(), and not __divdi3() for 'long long' division on 32-bit arches.
Diffstat (limited to 'module/spl/spl-kmem.c')
-rw-r--r--module/spl/spl-kmem.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index 6723dcd08..706691929 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -80,29 +80,30 @@ vmem_t *zio_arena = NULL;
EXPORT_SYMBOL(zio_arena);
#ifndef HAVE_GET_VMALLOC_INFO
-get_vmalloc_info_t get_vmalloc_info_fn = NULL;
+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
-first_online_pgdat_t first_online_pgdat_fn = NULL;
+first_online_pgdat_t first_online_pgdat_fn = SYMBOL_POISON;
EXPORT_SYMBOL(first_online_pgdat_fn);
#endif /* HAVE_FIRST_ONLINE_PGDAT */
#ifndef HAVE_NEXT_ONLINE_PGDAT
-next_online_pgdat_t next_online_pgdat_fn = NULL;
+next_online_pgdat_t next_online_pgdat_fn = SYMBOL_POISON;
EXPORT_SYMBOL(next_online_pgdat_fn);
#endif /* HAVE_NEXT_ONLINE_PGDAT */
#ifndef HAVE_NEXT_ZONE
-next_zone_t next_zone_fn = NULL;
+next_zone_t next_zone_fn = SYMBOL_POISON;
EXPORT_SYMBOL(next_zone_fn);
#endif /* HAVE_NEXT_ZONE */
#ifndef HAVE_ZONE_STAT_ITEM_FIA
# ifndef HAVE_GET_ZONE_COUNTS
-get_zone_counts_t get_zone_counts_fn = NULL;
+get_zone_counts_t get_zone_counts_fn = SYMBOL_POISON;
EXPORT_SYMBOL(get_zone_counts_fn);
+# endif /* HAVE_GET_ZONE_COUNTS */
unsigned long
spl_global_page_state(int item)
@@ -126,12 +127,13 @@ spl_global_page_state(int item)
return active;
}
+# ifdef HAVE_GLOBAL_PAGE_STATE
return global_page_state((enum zone_stat_item)item);
+# else
+ return 0; /* Unsupported */
+# endif /* HAVE_GLOBAL_PAGE_STATE */
}
EXPORT_SYMBOL(spl_global_page_state);
-# else
-# error "HAVE_ZONE_STAT_ITEM_FIA and HAVE_GET_ZONE_COUNTS unavailable"
-# endif /* HAVE_GET_ZONE_COUNTS */
#endif /* HAVE_ZONE_STAT_ITEM_FIA */
pgcnt_t
@@ -1785,8 +1787,8 @@ spl_kmem_init_globals(void)
}
/* Solaris default values */
- swapfs_minfree = MAX(2*1024*1024 / PAGE_SIZE, physmem / 8);
- swapfs_reserve = MIN(4*1024*1024 / PAGE_SIZE, physmem / 16);
+ swapfs_minfree = MAX(2*1024*1024 >> PAGE_SHIFT, physmem >> 3);
+ swapfs_reserve = MIN(4*1024*1024 >> PAGE_SHIFT, physmem >> 4);
}
/*
@@ -1839,8 +1841,6 @@ spl_kmem_init_kallsyms_lookup(void)
printk(KERN_ERR "Error: Unknown symbol get_zone_counts\n");
return -EFAULT;
}
-# else
-# error "HAVE_ZONE_STAT_ITEM_FIA and HAVE_GET_ZONE_COUNTS unavailable"
# endif /* HAVE_GET_ZONE_COUNTS */
#endif /* HAVE_ZONE_STAT_ITEM_FIA */