summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-kmem.c
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2014-10-01 18:05:39 -0400
committerBrian Behlendorf <behlendorf1@llnl.gov>2014-10-17 15:11:51 -0700
commite1310afae3bdb17628b40c35561f2daedfaf4062 (patch)
treec9d23ff519c714167fc06d9d73dc6d6a867e496a /module/spl/spl-kmem.c
parent50e41ab1e12f0b007239c55bfa77d02f6e8ba890 (diff)
Remove get_vmalloc_info() wrapper
The get_vmalloc_info() function was used to back the vmem_size() function. This was always problematic and resulted in brittle code because the kernel never provided a clean interface for modules. However, it turns out that the only caller of this function in ZFS uses it to determine the total virtual address space size. This can be determined easily without get_vmalloc_info() so vmem_size() has been updated to take this approach which allows us to shed the get_vmalloc_info() dependency. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Diffstat (limited to 'module/spl/spl-kmem.c')
-rw-r--r--module/spl/spl-kmem.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index ed2510865..7626a2951 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -148,11 +148,6 @@ EXPORT_SYMBOL(zio_alloc_arena);
vmem_t *zio_arena = NULL;
EXPORT_SYMBOL(zio_arena);
-#ifndef HAVE_GET_VMALLOC_INFO
-get_vmalloc_info_t get_vmalloc_info_fn = SYMBOL_POISON;
-EXPORT_SYMBOL(get_vmalloc_info_fn);
-#endif /* HAVE_GET_VMALLOC_INFO */
-
#ifdef HAVE_PGDAT_HELPERS
# ifndef HAVE_FIRST_ONLINE_PGDAT
first_online_pgdat_t first_online_pgdat_fn = SYMBOL_POISON;
@@ -270,20 +265,11 @@ EXPORT_SYMBOL(spl_kmem_availrmem);
size_t
vmem_size(vmem_t *vmp, int typemask)
{
- struct vmalloc_info vmi;
- size_t size = 0;
-
- ASSERT(vmp == NULL);
- ASSERT(typemask & (VMEM_ALLOC | VMEM_FREE));
-
- get_vmalloc_info(&vmi);
- if (typemask & VMEM_ALLOC)
- size += (size_t)vmi.used;
+ ASSERT3P(vmp, ==, NULL);
+ ASSERT3S(typemask & VMEM_ALLOC, ==, VMEM_ALLOC);
+ ASSERT3S(typemask & VMEM_FREE, ==, VMEM_FREE);
- if (typemask & VMEM_FREE)
- size += (size_t)(VMALLOC_TOTAL - vmi.used);
-
- return size;
+ return (VMALLOC_TOTAL);
}
EXPORT_SYMBOL(vmem_size);
@@ -2500,15 +2486,6 @@ spl_kmem_init_globals(void)
int
spl_kmem_init_kallsyms_lookup(void)
{
-#ifndef HAVE_GET_VMALLOC_INFO
- get_vmalloc_info_fn = (get_vmalloc_info_t)
- spl_kallsyms_lookup_name("get_vmalloc_info");
- if (!get_vmalloc_info_fn) {
- printk(KERN_ERR "Error: Unknown symbol get_vmalloc_info\n");
- return -EFAULT;
- }
-#endif /* HAVE_GET_VMALLOC_INFO */
-
#ifdef HAVE_PGDAT_HELPERS
# ifndef HAVE_FIRST_ONLINE_PGDAT
first_online_pgdat_fn = (first_online_pgdat_t)