summaryrefslogtreecommitdiffstats
path: root/libdm/mm
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-03-26 09:25:18 +0000
committerMilan Broz <mbroz@redhat.com>2009-03-26 09:25:18 +0000
commitaa8111b3cd94001cd915120b0ff67ead116aeaca (patch)
tree079bbecd5e7b56b6cb3179b9b456334be0e69baf /libdm/mm
parent0ef8308f1b66728185fcb7d2d615dbdf2024c08f (diff)
downloadlvm2-aa8111b3cd94001cd915120b0ff67ead116aeaca.tar.gz
lvm2-aa8111b3cd94001cd915120b0ff67ead116aeaca.tar.xz
lvm2-aa8111b3cd94001cd915120b0ff67ead116aeaca.zip
fix some issues when compiling with -D DEBUG_POOL
- fix compilation issues - fix wrong pool object maipulation (lvm dumpconfig triggers assert) - second iteration in loop _log_parallel_areas operates on non-existing object
Diffstat (limited to 'libdm/mm')
-rw-r--r--libdm/mm/pool-debug.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libdm/mm/pool-debug.c b/libdm/mm/pool-debug.c
index b656cc27..911f8e2b 100644
--- a/libdm/mm/pool-debug.c
+++ b/libdm/mm/pool-debug.c
@@ -14,6 +14,7 @@
*/
#include "dmlib.h"
+#include <assert.h>
struct block {
struct block *next;
@@ -43,7 +44,7 @@ struct dm_pool {
/* by default things come out aligned for doubles */
#define DEFAULT_ALIGNMENT __alignof__ (double)
-struct pool *dm_pool_create(const char *name, size_t chunk_hint)
+struct dm_pool *dm_pool_create(const char *name, size_t chunk_hint)
{
struct dm_pool *mem = dm_malloc(sizeof(*mem));
@@ -130,8 +131,6 @@ static void _append_block(struct dm_pool *p, struct block *b)
static struct block *_new_block(size_t s, unsigned alignment)
{
- static const char *_oom = "Out of memory";
-
/* FIXME: I'm currently ignoring the alignment arg. */
size_t len = sizeof(struct block) + s;
struct block *b = dm_malloc(len);
@@ -144,12 +143,12 @@ static struct block *_new_block(size_t s, unsigned alignment)
assert(alignment == DEFAULT_ALIGNMENT);
if (!b) {
- log_err(_oom);
+ log_err("Out of memory");
return NULL;
}
if (!(b->data = dm_malloc(s))) {
- log_err(_oom);
+ log_err("Out of memory");
dm_free(b);
return NULL;
}