diff options
author | wartens2 <wartens2@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-24 17:07:56 +0000 |
---|---|---|
committer | wartens2 <wartens2@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-24 17:07:56 +0000 |
commit | 8100fe56f1d249afbb0232ac0a8ee6d598ad9e5f (patch) | |
tree | 4a07f9a385a018502e6f7823ac99329a183360c0 /include | |
parent | 6e605b6e5824c300b9e1953fe4ac9c8fc15d695f (diff) |
Make sure that when calling __vmem_alloc that we
do not have __GFP_ZERO set. Once the memory is allocated
then zero out the memory if __GFP_ZERO is passed to
__vmem_alloc.
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@88 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/kmem.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 7af10f9a4..a02bdcbff 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -72,14 +72,17 @@ extern int kmem_warning_flag; \ ASSERT(flags & KM_SLEEP); \ \ - _ptr_ = (void *)__vmalloc((size), ((flags) | \ - __GFP_HIGHMEM), PAGE_KERNEL); \ + _ptr_ = (void *)__vmalloc((size), (((flags) | \ + __GFP_HIGHMEM) & \ + ~__GFP_ZERO), PAGE_KERNEL); \ if (_ptr_ == NULL) { \ printk("spl: Warning vmem_alloc(%d, 0x%x) failed at %s:%d " \ "(%ld/%ld)\n", (int)(size), (int)(flags), \ __FILE__, __LINE__, \ atomic64_read(&vmem_alloc_used), vmem_alloc_max); \ } else { \ + if (flags & __GFP_ZERO) \ + memset(_ptr_, 0, (size)); \ atomic64_add((size), &vmem_alloc_used); \ if (unlikely(atomic64_read(&vmem_alloc_used)>vmem_alloc_max)) \ vmem_alloc_max = atomic64_read(&vmem_alloc_used); \ |