diff options
author | hunt <hunt> | 2006-11-15 17:52:23 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-11-15 17:52:23 +0000 |
commit | 132c23b4b9134b9e8969fb57484f9fcdad1d46f5 (patch) | |
tree | 48d8da3e2d81b34c2438dc4b2631c1781e042bdf /runtime/map.c | |
parent | 2698d4879f43304658c327860c5b803e10c99c10 (diff) | |
download | systemtap-steved-132c23b4b9134b9e8969fb57484f9fcdad1d46f5.tar.gz systemtap-steved-132c23b4b9134b9e8969fb57484f9fcdad1d46f5.tar.xz systemtap-steved-132c23b4b9134b9e8969fb57484f9fcdad1d46f5.zip |
2006-11-15 Martin Hunt <hunt@redhat.com>
* alloc.c (STP_ALLOC_FLAGS): Define.
Cleanup ifdefs.
* map.c: Use STP_ALLOC_FLAGS.
* stat.c: ditto.
Diffstat (limited to 'runtime/map.c')
-rw-r--r-- | runtime/map.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/runtime/map.c b/runtime/map.c index 326f95aa..843a8543 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -187,8 +187,8 @@ static int _stp_map_init(MAP m, unsigned max_entries, int type, int key_size, in return -1; } if (max_entries) { - void *tmp; int i; + void *tmp; /* size is the size of the map_node. */ /* add space for the value. */ @@ -202,14 +202,12 @@ static int _stp_map_init(MAP m, unsigned max_entries, int type, int key_size, in for (i = 0; i < max_entries; i++) { if (cpu < 0) - tmp = kmalloc(size, GFP_KERNEL); + tmp = kmalloc(size, STP_ALLOC_FLAGS); else - tmp = kmalloc_node(size, GFP_KERNEL, cpu); + tmp = kmalloc_node(size, STP_ALLOC_FLAGS, cpu); - if (!tmp) { - _stp_error("Allocating memory while creating map failed.\n"); - return -1; - } + if (!tmp) + return -1;; dbug ("allocated %lx\n", (long)tmp); list_add((struct list_head *)tmp, &m->pool); @@ -219,12 +217,12 @@ static int _stp_map_init(MAP m, unsigned max_entries, int type, int key_size, in if (type == STAT) m->hist.type = HIST_NONE; return 0; - } +} static MAP _stp_map_new(unsigned max_entries, int type, int key_size, int data_size) { - MAP m = (MAP) kmalloc(sizeof(struct map_root), GFP_KERNEL); + MAP m = (MAP) kmalloc(sizeof(struct map_root), STP_ALLOC_FLAGS); if (m == NULL) return NULL; @@ -243,7 +241,7 @@ static PMAP _stp_pmap_new(unsigned max_entries, int type, int key_size, int data int i; MAP map, m; - PMAP pmap = (PMAP) kmalloc(sizeof(struct pmap), GFP_KERNEL); + PMAP pmap = (PMAP) kmalloc(sizeof(struct pmap), STP_ALLOC_FLAGS); if (pmap == NULL) return NULL; |