Browse Source

lvm2: Updated (2.02.111 -> 2.02.116)

master
Nagy Karoly Gabriel 10 years ago
parent
commit
4b4a051fe0
  1. 6
      base/lvm2/lvm2.desc
  2. 78
      base/musl/pkg/lvm2/lvm2-musl-no-mallinfo.patch

6
base/lvm2/lvm2.desc

@ -2,7 +2,7 @@
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../lvm2/lvm2.desc
[COPY] Copyright (C) 2006 - 2014 The OpenSDE Project
[COPY] Copyright (C) 2006 - 2015 The OpenSDE Project
[COPY] Copyright (C) 2004 - 2006 The T2 SDE Project
[COPY] Copyright (C) 1998 - 2004 Clifford Wolf
[COPY]
@ -33,7 +33,7 @@
[L] GPL
[S] Stable
[V] 2.02.111
[V] 2.02.116
[P] X -?-3-----9 184.000
[D] 3955402158 LVM2.2.02.111.tgz ftp://sources.redhat.com/pub/lvm2/
[D] 3687889870 LVM2.2.02.116.tgz ftp://sources.redhat.com/pub/lvm2/

78
base/musl/pkg/lvm2/lvm2-musl-no-mallinfo.patch

@ -0,0 +1,78 @@
--- ./lib/mm/memlock.c.orig 2015-01-30 17:19:53.000000000 +0100
+++ ./lib/mm/memlock.c 2015-02-10 12:33:01.996864282 +0100
@@ -25,7 +25,6 @@
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include <malloc.h>
#ifndef DEVMAPPER_SUPPORT
@@ -134,11 +133,9 @@
static void _allocate_memory(void)
{
#ifndef VALGRIND_POOL
- void *stack_mem;
+ /* With Valgrind don't waste time in with preallocating memory */
+ void *stack_mem, *temp_malloc_mem;
struct rlimit limit;
- int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
- char *areas[max_areas];
-
/* Check if we could preallocate requested stack */
if ((getrlimit (RLIMIT_STACK, &limit) == 0) &&
((_size_stack * 2) < limit.rlim_cur) &&
@@ -146,50 +143,12 @@
_touch_memory(stack_mem, _size_stack);
/* FIXME else warn user setting got ignored */
- /*
- * When a brk() fails due to fragmented address space (which sometimes
- * happens when we try to grab 8M or so), glibc will make a new
- * arena. In this arena, the rules for using “direct” mmap are relaxed,
- * circumventing the MAX_MMAPs and MMAP_THRESHOLD settings. We can,
- * however, detect when this happens with mallinfo() and try to co-opt
- * malloc into using MMAP as a MORECORE substitute instead of returning
- * MMAP'd memory directly. Since MMAP-as-MORECORE does not munmap the
- * memory on free(), this is good enough for our purposes.
- */
- while (missing > 0) {
- struct mallinfo inf = mallinfo();
- hblks = inf.hblks;
-
- if ((areas[area] = malloc(_size_malloc_tmp)))
- _touch_memory(areas[area], _size_malloc_tmp);
-
- inf = mallinfo();
-
- if (hblks < inf.hblks) {
- /* malloc cheated and used mmap, even though we told it
- not to; we try with twice as many areas, each half
- the size, to circumvent the faulty logic in glibc */
- free(areas[area]);
- _size_malloc_tmp /= 2;
- } else {
- ++ area;
- missing -= _size_malloc_tmp;
- }
-
- if (area == max_areas && missing > 0) {
- /* Too bad. Warn the user and proceed, as things are
- * most likely going to work out anyway. */
- log_warn("WARNING: Failed to reserve memory, %d bytes missing.", missing);
- break;
- }
- }
+ if ((temp_malloc_mem = malloc(_size_malloc_tmp)))
+ _touch_memory(temp_malloc_mem, _size_malloc_tmp);
if ((_malloc_mem = malloc(_size_malloc)))
_touch_memory(_malloc_mem, _size_malloc);
-
- /* free up the reserves so subsequent malloc's can use that memory */
- for (i = 0; i < area; ++i)
- free(areas[i]);
+ free(temp_malloc_mem);
#endif
}
Loading…
Cancel
Save