master - device_mapper: remove dbg_malloc.
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d5da55ed85248adb066d293c2a1b863ce17d2779 Commit: d5da55ed85248adb066d293c2a1b863ce17d2779 Parent: c78239d8605f333915543c0e0c3ccf4f4ef5ee8f Author: Joe Thornber <[email protected]> AuthorDate: Fri Jun 8 13:40:53 2018 +0100 Committer: Joe Thornber <[email protected]> CommitterDate: Fri Jun 8 13:40:53 2018 +0100
device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind. These days there's just no need.
--- daemons/cmirrord/functions.c | 14 +- daemons/dmeventd/dmeventd.c | 72 +++--- daemons/dmeventd/libdevmapper-event.c | 64 +++--- daemons/dmfilemapd/dmfilemapd.c | 14 +- daemons/lvmetad/lvmetad-core.c | 78 +++--- daemons/lvmpolld/lvmpolld-cmd-utils.c | 10 +- daemons/lvmpolld/lvmpolld-core.c | 16 +- daemons/lvmpolld/lvmpolld-data-utils.c | 54 ++-- device_mapper/Makefile | 1 - device_mapper/all.h | 44 +--- device_mapper/datastruct/bitset.c | 5 +- device_mapper/datastruct/hash.c | 21 +- device_mapper/ioctl/libdm-iface.c | 56 +++--- device_mapper/libdm-common.c | 57 +++--- device_mapper/libdm-config.c | 8 +- device_mapper/libdm-deptree.c | 5 +- device_mapper/libdm-file.c | 4 +- device_mapper/libdm-report.c | 45 ++-- device_mapper/libdm-stats.c | 119 +++++----- device_mapper/libdm-string.c | 12 +- device_mapper/libdm-timestamp.c | 7 +- device_mapper/mm/dbg_malloc.c | 413 -------------------------------- device_mapper/mm/pool-debug.c | 20 +- device_mapper/mm/pool-fast.c | 9 +- lib/activate/activate.c | 2 +- lib/activate/dev_manager.c | 4 +- lib/activate/fs.c | 4 +- lib/cache/lvmcache.c | 57 +++--- lib/cache/lvmetad.c | 4 +- lib/cache_segtype/cache.c | 7 +- lib/commands/toolcontext.c | 15 +- lib/config/config.c | 16 +- lib/device/bcache.c | 40 ++-- lib/device/dev-cache.c | 29 ++- lib/device/dev-io.c | 4 +- lib/device/dev-type.c | 5 +- lib/device/device.h | 2 +- lib/error/errseg.c | 5 +- lib/filters/filter-composite.c | 11 +- lib/filters/filter-fwraid.c | 5 +- lib/filters/filter-internal.c | 5 +- lib/filters/filter-md.c | 5 +- lib/filters/filter-mpath.c | 5 +- lib/filters/filter-partitioned.c | 5 +- lib/filters/filter-persistent.c | 19 +- lib/filters/filter-signature.c | 5 +- lib/filters/filter-type.c | 5 +- lib/filters/filter-usable.c | 11 +- lib/format_text/archiver.c | 8 +- lib/format_text/export.c | 33 ++-- lib/format_text/flags.c | 4 +- lib/format_text/format-text.c | 32 ++-- lib/format_text/text_label.c | 19 +- lib/freeseg/freeseg.c | 5 +- lib/label/label.c | 21 +- lib/log/log.c | 10 +- lib/lvmpolld/lvmpolld-client.c | 4 +- lib/metadata/lv_manip.c | 6 +- lib/metadata/metadata-liblvm.c | 6 +- lib/mirror/mirrored.c | 7 +- lib/misc/lib.h | 1 + lib/misc/lvm-file.c | 10 +- lib/misc/lvm-flock.c | 14 +- lib/mm/memlock.c | 4 +- lib/raid/raid.c | 11 +- lib/snapshot/snapshot.c | 7 +- lib/striped/striped.c | 5 +- lib/thin/thin.c | 7 +- lib/unknown/unknown.c | 11 +- lib/zero/zero.c | 5 +- libdaemon/client/config-util.c | 10 +- libdaemon/client/daemon-client.c | 6 +- libdaemon/server/daemon-log.c | 12 +- libdaemon/server/daemon-server.c | 4 +- tools/command.c | 36 ++-- tools/dmsetup.c | 95 ++++---- tools/lvmcmdlib.c | 4 +- tools/pvck.c | 3 +- tools/toollib.c | 2 +- tools/vgcfgbackup.c | 12 +- 80 files changed, 714 insertions(+), 1118 deletions(-)
daemons/cmirrord/functions.c +7 -7
@@ -435,7 +435,7 @@ static int _clog_ctr(char *uuid, uint64_t luid, block_on_error =1 ; } - lc =dm_zalloc (sizeof (*lc)); + lc =zalloc (sizeof (*lc));if (!lc) {LOG_ERROR ("Unable to allocate cluster log context" ); r = -ENOMEM ;
@@ -532,9 +532,9 @@ fail:LOG_ERROR ("Close device error, %s: %s" , disk_path,strerror (errno));free (lc->disk_buffer); -dm_free (lc->sync_bits); -dm_free (lc->clean_bits); -dm_free (lc); +free (lc->sync_bits); +free (lc->clean_bits); +free (lc); }return r; }
@@ -659,9 +659,9 @@ static int clog_dtr(struct dm_ulog_request *rq) strerror(errno));if (lc->disk_buffer)free (lc->disk_buffer); -dm_free (lc->clean_bits); -dm_free (lc->sync_bits); -dm_free (lc); +free (lc->clean_bits); +free (lc->sync_bits); +free (lc);return 0 ; }
daemons/dmeventd/dmeventd.c +36 -36
220 lines not on this page · raw message
daemons/dmeventd/libdevmapper-event.c +32 -32
202 lines not on this page · raw message
daemons/dmfilemapd/dmfilemapd.c +7 -7
@@ -311,7 +311,7 @@ static int _parse_args(int argc, char **argv, struct filemap_monitor *fm)return 0 ; } - fm->path =dm_strdup (argv[0 ]); + fm->path =strdup (argv[0 ]);if (!fm->path) {_early_log ("Could not allocate memory for path argument." );return 0 ;
@@ -538,8 +538,8 @@ static void _filemap_monitor_destroy(struct filemap_monitor *fm)_filemap_monitor_end_notify (fm);_filemap_monitor_close_fd (fm); } -dm_free ((void *) fm->program_id); -dm_free (fm->path); +free ((void *) fm->program_id); +free (fm->path); }static int _filemap_monitor_check_same_file (int fd1,int fd2)
@@ -699,7 +699,7 @@ static int _update_regions(struct dm_stats *dms, struct filemap_monitor *fm) fm->group_id, regions[0]); fm->group_id = regions[0 ]; } -dm_free (regions); +free (regions); fm->nr_regions = nr_regions;return 1 ; }
@@ -741,7 +741,7 @@ static int _dmfilemapd(struct filemap_monitor *fm)*/ program_id =dm_stats_get_region_program_id (dms, fm->group_id);if (program_id) - fm->program_id =dm_strdup (program_id); + fm->program_id =strdup (program_id);else fm->program_id =NULL ;dm_stats_set_program_id (dms,1 , program_id);
@@ -817,7 +817,7 @@ int main(int argc, char **argv)memset (&fm,0 ,sizeof (fm));if (!_parse_args (argc, argv, &fm)) { -dm_free (fm.path); +free (fm.path);return 1 ; }
@@ -828,7 +828,7 @@ int main(int argc, char **argv) _mode_names[fm.mode], fm.path);if (!_foreground && !_daemonise (&fm)) { -dm_free (fm.path); +free (fm.path);return 1 ; }
daemons/lvmetad/lvmetad-core.c +39 -39
254 lines not on this page · raw message
daemons/lvmpolld/lvmpolld-cmd-utils.c +5 -5
@@ -36,7 +36,7 @@ static int add_to_cmd_arr(const char ***cmdargv, const char *str, unsigned *ind)const char **newargv;if (*ind && !(*ind %MIN_ARGV_SIZE )) { - newargv =dm_realloc (*cmdargv, (*ind /MIN_ARGV_SIZE +1 ) *MIN_ARGV_SIZE *sizeof (char *)); + newargv =realloc (*cmdargv, (*ind /MIN_ARGV_SIZE +1 ) *MIN_ARGV_SIZE *sizeof (char *));if (!newargv)return 0 ; *cmdargv = newargv;
@@ -50,7 +50,7 @@ static int add_to_cmd_arr(const char ***cmdargv, const char *str, unsigned *ind)const char **cmdargv_ctr (const struct lvmpolld_lv *pdlv,const char *lvm_binary,unsigned abort_polling,unsigned handle_missing_pvs) {unsigned i =0 ; -const char **cmd_argv =dm_malloc (MIN_ARGV_SIZE *sizeof (char *)); +const char **cmd_argv =malloc (MIN_ARGV_SIZE *sizeof (char *));if (!cmd_argv)return NULL ;
@@ -98,7 +98,7 @@ const char **cmdargv_ctr(const struct lvmpolld_lv *pdlv, const char *lvm_binary,return cmd_argv; err: -dm_free (cmd_argv); +free (cmd_argv);return NULL ; }
@@ -122,7 +122,7 @@ static int copy_env(const char ***cmd_envp, unsigned *i, const char *exclude)const char **cmdenvp_ctr (const struct lvmpolld_lv *pdlv) {unsigned i =0 ; -const char **cmd_envp =dm_malloc (MIN_ARGV_SIZE *sizeof (char *)); +const char **cmd_envp =malloc (MIN_ARGV_SIZE *sizeof (char *));if (!cmd_envp)return NULL ;
@@ -141,6 +141,6 @@ const char **cmdenvp_ctr(const struct lvmpolld_lv *pdlv)return cmd_envp; err: -dm_free (cmd_envp); +free (cmd_envp);return NULL ; }
daemons/lvmpolld/lvmpolld-core.c +8 -8
@@ -530,7 +530,7 @@ static response progress_info(client_handle h, struct lvmpolld_state *ls, requespdst_unlock (pdst); -dm_free (id); +free (id);if (pdlv) {if (st.error)
@@ -673,7 +673,7 @@ static response poll_init(client_handle h, struct lvmpolld_state *ls, request rePD_LOG_PREFIX ,"poll operation type mismatch on LV identified by" , id, polling_op(pdlv_get_type(pdlv)), polling_op(type)); -dm_free (id); +free (id);return reply (LVMPD_RESP_EINVAL ,REASON_DIFFERENT_OPERATION_IN_PROGRESS ); }
@@ -683,14 +683,14 @@ static response poll_init(client_handle h, struct lvmpolld_state *ls, request re lvname, sysdir, type, abort_polling, 2 * uinterval);if (!pdlv) {pdst_unlock (pdst); -dm_free (id); +free (id);return reply (LVMPD_RESP_FAILED ,REASON_ENOMEM ); }if (!pdst_locked_insert (pdst, id, pdlv)) {pdlv_destroy (pdlv);pdst_unlock (pdst);ERROR (ls,"%s: %s" ,PD_LOG_PREFIX ,"couldn't store internal LV data structure" ); -dm_free (id); +free (id);return reply (LVMPD_RESP_FAILED ,REASON_ENOMEM ); }if (!spawn_detached_thread (pdlv)) {
@@ -698,7 +698,7 @@ static response poll_init(client_handle h, struct lvmpolld_state *ls, request repdst_locked_remove (pdst, id);pdlv_destroy (pdlv);pdst_unlock (pdst); -dm_free (id); +free (id);return reply (LVMPD_RESP_FAILED ,REASON_ENOMEM ); }
@@ -709,7 +709,7 @@ static response poll_init(client_handle h, struct lvmpolld_state *ls, request repdst_unlock (pdst); -dm_free (id); +free (id);return daemon_reply_simple (LVMPD_RESP_OK ,NULL ); }
@@ -806,7 +806,7 @@ static int printout_raw_response(const char *prefix, const char *msg)char *buf;char *pos; - buf =dm_strdup (msg); + buf =strdup (msg); pos = buf;if (!buf)
@@ -819,7 +819,7 @@ static int printout_raw_response(const char *prefix, const char *msg)_log_line (pos, &b); pos = next ? next +1 :0 ; } -dm_free (buf); +free (buf);return 1 ; }
daemons/lvmpolld/lvmpolld-data-utils.c +27 -27
153 lines not on this page · raw message
device_mapper/Makefile +0 -1
@@ -22,7 +22,6 @@ DEVICE_MAPPER_SOURCE=\ device_mapper/libdm-string.c \ device_mapper/libdm-targets.c \ device_mapper/libdm-timestamp.c \ - device_mapper/mm/dbg_malloc.c \ device_mapper/mm/pool.c \ device_mapper/regex/matcher.c \ device_mapper/regex/parse_rx.c \
device_mapper/all.h +7 -37
92 lines not on this page · raw message
device_mapper/datastruct/bitset.c +3 -2
@@ -14,6 +14,7 @@*/ #include "device_mapper/misc/dmlib.h" +#include "base/memory/zalloc.h" #include <ctype.h>
@@ -29,7 +30,7 @@ dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits)if (mem) bs =dm_pool_zalloc (mem, size);else - bs =dm_zalloc (size); + bs =zalloc (size);if (!bs)return NULL ;
@@ -41,7 +42,7 @@ dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits)void dm_bitset_destroy (dm_bitset_t bs) { -dm_free (bs); +free (bs); }int dm_bitset_equal (dm_bitset_t in1,dm_bitset_t in2)
device_mapper/datastruct/hash.c +11 -10
@@ -14,6 +14,7 @@*/ #include "device_mapper/misc/dmlib.h" +#include "base/memory/zalloc.h" struct dm_hash_node {struct dm_hash_node *next;
@@ -59,7 +60,7 @@ static unsigned char _nums[] = {static struct dm_hash_node *_create_node (const char *str,unsigned len) { -struct dm_hash_node *n =dm_malloc (sizeof (*n) + len); +struct dm_hash_node *n =malloc (sizeof (*n) + len);if (n) {memcpy (n->key, str, len);
@@ -91,7 +92,7 @@ struct dm_hash_table *dm_hash_create(unsigned size_hint) {size_t len;unsigned new_size =16u ; -struct dm_hash_table *hc =dm_zalloc (sizeof (*hc)); +struct dm_hash_table *hc =zalloc (sizeof (*hc));if (!hc) return_0;
@@ -102,14 +103,14 @@ struct dm_hash_table *dm_hash_create(unsigned size_hint) hc->num_slots = new_size; len =sizeof (*(hc->slots)) * new_size; -if (!(hc->slots =dm_zalloc (len))) +if (!(hc->slots =zalloc (len))) goto_bad;return hc; bad: -dm_free (hc->slots); -dm_free (hc); +free (hc->slots); +free (hc);return 0 ; }
@@ -121,15 +122,15 @@ static void _free_nodes(struct dm_hash_table *t)for (i =0 ; i < t->num_slots; i++)for (c = t->slots[i]; c; c = n) { n = c->next; -dm_free (c); +free (c); } }void dm_hash_destroy (struct dm_hash_table *t) {_free_nodes (t); -dm_free (t->slots); -dm_free (t); +free (t->slots); +free (t); } static struct dm_hash_node **_find(struct dm_hash_table *t, const void *key,
@@ -187,7 +188,7 @@ void dm_hash_remove_binary(struct dm_hash_table *t, const void *key,if (*c) {struct dm_hash_node *old = *c; *c = (*c)->next; -dm_free (old); +free (old); t->num_nodes--; } }
@@ -287,7 +288,7 @@ void dm_hash_remove_with_val(struct dm_hash_table *t, const char *key,if (c && *c) {struct dm_hash_node *old = *c; *c = (*c)->next; -dm_free (old); +free (old); t->num_nodes--; } }
device_mapper/ioctl/libdm-iface.c +28 -28
151 lines not on this page · raw message
device_mapper/libdm-common.c +29 -28
163 lines not on this page · raw message
device_mapper/libdm-config.c +4 -4
@@ -269,11 +269,11 @@ static int _line_append(struct config_output *out, const char *fmt, ...)if (!dm_pool_grow_object (out->mem, dyn_buf ? : buf,0 )) {log_error ("dm_pool_grow_object failed for config line" ); -dm_free (dyn_buf); +free (dyn_buf);return 0 ; } -dm_free (dyn_buf); +free (dyn_buf);return 1 ; }
@@ -1441,12 +1441,12 @@ static int _enumerate(const char *path, struct dm_config_node *cn, int (*cb)(con }else if (!cb (sub, cn, baton)) goto_bad; -dm_free (sub); +free (sub); cn = cn->sib; }return 1 ; bad: -dm_free (sub); +free (sub);return 0 ; }
device_mapper/libdm-deptree.c +3 -2
@@ -19,6 +19,7 @@#include "misc/dm-ioctl.h" #include <stdarg.h> +#include <string.h> #include <sys/param.h> #include <sys/utsname.h>
@@ -2660,7 +2661,7 @@ static int _emit_segment(struct dm_task *dmt, uint32_t major, uint32_t minor,int ret; do { - if (!(params = dm_malloc(paramsize))) { + if (!(params = malloc(paramsize))) { log_error("Insufficient space for target parameters."); return 0; }
@@ -2668,7 +2669,7 @@ static int _emit_segment(struct dm_task *dmt, uint32_t major, uint32_t minor, params[0 ] ='\0' ; ret =_emit_segment_line (dmt, major, minor, seg, seg_start, params, paramsize); -dm_free (params); +free (params);if (!ret) stack;
device_mapper/libdm-file.c +2 -2
@@ -45,7 +45,7 @@ static int _create_dir_recursive(const char *dir)log_verbose ("Creating directory \"%s\"" , dir);/* Create parent directories */ - orig = s =dm_strdup (dir); + orig = s =strdup (dir);if (!s) {log_error ("Failed to duplicate directory name." );return 0 ;
@@ -84,7 +84,7 @@ static int _create_dir_recursive(const char *dir) r =1 ; out: -dm_free (orig); +free (orig);return r; }
device_mapper/libdm-report.c +23 -22
156 lines not on this page · raw message
device_mapper/libdm-stats.c +60 -59
401 lines not on this page · raw message
device_mapper/libdm-string.c +6 -6
@@ -146,7 +146,7 @@ int dm_vasprintf(char **result, const char *format, va_list aq) {int i, n, size =16 ;va_list ap; -char *buf =dm_malloc (size); +char *buf =malloc (size); *result =0 ;
@@ -161,20 +161,20 @@ int dm_vasprintf(char **result, const char *format, va_list aq)if (0 <= n && n < size)break ; -dm_free (buf); +free (buf);/* Up to glibc 2.0.6 returns -1 */ size = (n <0 ) ? size *2 : n +1 ; -if (!(buf =dm_malloc (size))) +if (!(buf =malloc (size)))return -1 ; }if (i >1 ) {/* Reallocating more then once? */ -if (!(*result =dm_strdup (buf))) { -dm_free (buf); +if (!(*result =strdup (buf))) { +free (buf);return -1 ; } -dm_free (buf); +free (buf); }else *result = buf;
device_mapper/libdm-timestamp.c +4 -3
@@ -18,6 +18,7 @@* the results of these routines should stay in-core. */ +#include "base/memory/zalloc.h" #include "misc/dmlib.h" #include <stdlib.h>
@@ -53,7 +54,7 @@ struct dm_timestamp *dm_timestamp_alloc(void) {struct dm_timestamp *ts =NULL ; -if (!(ts =dm_zalloc (sizeof (*ts)))) +if (!(ts =zalloc (sizeof (*ts)))) stack;return ts;
@@ -101,7 +102,7 @@ struct dm_timestamp *dm_timestamp_alloc(void) {struct dm_timestamp *ts; -if (!(ts =dm_malloc (sizeof (*ts)))) +if (!(ts =malloc (sizeof (*ts)))) stack;return ts;
@@ -174,5 +175,5 @@ void dm_timestamp_copy(struct dm_timestamp *ts_new, struct dm_timestamp *ts_old)void dm_timestamp_destroy (struct dm_timestamp *ts) { -dm_free (ts); +free (ts); }
device_mapper/mm/dbg_malloc.c deleted +0 -413
413 lines not on this page · raw message
device_mapper/mm/pool-debug.c +10 -10
@@ -50,7 +50,7 @@ struct dm_pool {struct dm_pool *dm_pool_create (const char *name,size_t chunk_hint) { -struct dm_pool *mem =dm_zalloc (sizeof (*mem)); +struct dm_pool *mem =zalloc (sizeof (*mem));if (!mem) { log_error("Couldn't create memory pool %s (size %"
@@ -82,8 +82,8 @@ static void _free_blocks(struct dm_pool *p, struct block *b) p->stats.blocks_allocated--; n = b->next; -dm_free (b->data); -dm_free (b); +free (b->data); +free (b); b = n; } }
@@ -105,7 +105,7 @@ void dm_pool_destroy(struct dm_pool *p)_pool_stats (p,"Destroying" );_free_blocks (p, p->blocks);dm_list_del (&p->list); -dm_free (p); +free (p); }void *dm_pool_alloc (struct dm_pool *p,size_t s)
@@ -139,7 +139,7 @@ static struct block *_new_block(size_t s, unsigned alignment) {/* FIXME: I'm currently ignoring the alignment arg. */ size_t len =sizeof (struct block ) + s; -struct block *b =dm_malloc (len); +struct block *b =malloc (len);/* * Too lazy to implement alignment for debug version, and
@@ -153,9 +153,9 @@ static struct block *_new_block(size_t s, unsigned alignment)return NULL ; } -if (!(b->data =dm_malloc (s))) { +if (!(b->data =malloc (s))) {log_error ("Out of memory" ); -dm_free (b); +free (b);return NULL ; }
@@ -247,8 +247,8 @@ int dm_pool_grow_object(struct dm_pool *p, const void *extra, size_t delta)if (p->object) {memcpy (new->data, p->object->data, p->object->size); -dm_free (p->object->data); -dm_free (p->object); +free (p->object->data); +free (p->object); } p->object = new;
@@ -270,7 +270,7 @@ void *dm_pool_end_object(struct dm_pool *p)void dm_pool_abandon_object (struct dm_pool *p) {assert (p->begun); -dm_free (p->object); +free (p->object); p->begun =0 ; p->object =NULL ; }
device_mapper/mm/pool-fast.c +5 -4
@@ -17,6 +17,7 @@#include "memcheck.h" #endif +#include "base/memory/zalloc.h" #include "device_mapper/misc/dmlib.h" #include <stddef.h> /* For musl libc */ #include <malloc.h>
@@ -48,7 +49,7 @@ static void _free_chunk(struct chunk *c);struct dm_pool *dm_pool_create (const char *name,size_t chunk_hint) {size_t new_size =1024 ; -struct dm_pool *p =dm_zalloc (sizeof (*p)); +struct dm_pool *p =zalloc (sizeof (*p));if (!p) { log_error("Couldn't create memory pool %s (size %"
@@ -82,7 +83,7 @@ void dm_pool_destroy(struct dm_pool *p)pthread_mutex_lock (&_dm_pools_mutex);dm_list_del (&p->list);pthread_mutex_unlock (&_dm_pools_mutex); -dm_free (p); +free (p); }void *dm_pool_alloc (struct dm_pool *p,size_t s)
@@ -281,7 +282,7 @@ static struct chunk *_new_chunk(struct dm_pool *p, size_t s)# define aligned_malloc (s) (posix_memalign((void**)&c, _pagesize, \ ALIGN_ON_PAGE(s)) == 0)#else -# define aligned_malloc (s) (c = dm_malloc(s)) +# define aligned_malloc (s) (c = malloc(s))#endif /* DEBUG_ENFORCE_POOL_LOCKING */ if (!aligned_malloc (s)) {#undef aligned_malloc
@@ -315,7 +316,7 @@ static void _free_chunk(struct chunk *c)/* since DEBUG_MEM is using own memory list */ free (c);/* for posix_memalign() */ #else -dm_free (c); +free (c);#endif }
lib/activate/activate.c +1 -1
@@ -1514,7 +1514,7 @@ char *get_monitor_dso_path(struct cmd_context *cmd, int id)get_shared_library_path (cmd, libpath, path,sizeof (path)); -return dm_strdup (path); +return strdup (path); }static char *_build_target_uuid (struct cmd_context *cmd,const struct logical_volume *lv)
lib/activate/dev_manager.c +2 -2
@@ -627,7 +627,7 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check) goto out; } -if (!(vgname =dm_strdup (name)) || +if (!(vgname =strdup (name)) || !dm_split_lvm_name (NULL ,NULL , &vgname, &lvname, &layer)) goto_out;
@@ -735,7 +735,7 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check) r =1 ; out: -dm_free (vgname); +free (vgname);dm_task_destroy (dmt);return r; }
lib/activate/fs.c +2 -2
@@ -327,7 +327,7 @@ static void _del_fs_op(struct fs_op_parms *fsp) { _count_fs_ops[fsp->type]--;dm_list_del (&fsp->list); -dm_free (fsp); +free (fsp); }/* Check if there is other the type of fs operation stacked */
@@ -401,7 +401,7 @@ static int _stack_fs_op(fs_op_t type, const char *dev_dir, const char *vg_name,_del_fs_op (fsp); } -if (!(fsp =dm_malloc (sizeof (*fsp) + len))) { +if (!(fsp =malloc (sizeof (*fsp) + len))) {log_error ("No space to stack fs operation" );return 0 ; }
lib/cache/lvmcache.c +29 -28
183 lines not on this page · raw message
lib/cache/lvmetad.c +2 -2
@@ -196,7 +196,7 @@ void lvmetad_set_token(const struct dm_config_value *filter) {int ft =0 ; -dm_free (_lvmetad_token); +free (_lvmetad_token);while (filter && filter->type ==DM_CFG_STRING ) { ft =calc_crc (ft, (const uint8_t *) filter->v.str,strlen (filter->v.str));
@@ -209,7 +209,7 @@ void lvmetad_set_token(const struct dm_config_value *filter)void lvmetad_release_token (void ) { -dm_free (_lvmetad_token); +free (_lvmetad_token); _lvmetad_token =NULL ; }
lib/cache_segtype/cache.c +4 -3
@@ -12,6 +12,7 @@* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "base/memory/zalloc.h" #include "lib/misc/lib.h" #include "lib/commands/toolcontext.h" #include "lib/metadata/segtype.h"
@@ -261,7 +262,7 @@ static int _cache_pool_text_export(const struct lv_segment *seg,static void _destroy (struct segment_type *segtype) { -dm_free ((void *) segtype); +free ((void *) segtype); }#ifdef DEVMAPPER_SUPPORT
@@ -611,7 +612,7 @@ int init_cache_segtypes(struct cmd_context *cmd, struct segtype_library *seglib) #endif { -struct segment_type *segtype =dm_zalloc (sizeof (*segtype)); +struct segment_type *segtype =zalloc (sizeof (*segtype));if (!segtype) {log_error ("Failed to allocate memory for cache_pool segtype" );
@@ -626,7 +627,7 @@ int init_cache_segtypes(struct cmd_context *cmd, return_0;log_very_verbose ("Initialised segtype: %s" , segtype->name); - segtype =dm_zalloc (sizeof (*segtype)); + segtype =zalloc (sizeof (*segtype));if (!segtype) {log_error ("Failed to allocate memory for cache segtype" );return 0 ;
lib/commands/toolcontext.c +8 -7
@@ -13,6 +13,7 @@* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "base/memory/zalloc.h" #include "lib/misc/lib.h" #include "lib/commands/toolcontext.h"
Lines of this file are not shown. View the raw message.
tools/dmsetup.c +48 -47
95 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.