LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2008-01-30 13:19:47
Modified files:
. : WHATS_NEW lib/activate : dev_manager.c fs.c lib/cache : lvmcache.c lib/commands : toolcontext.c lib/config : config.c
lib/datastruct : btree.c str_list.c
lib/device : dev-cache.c dev-io.c device.c
lib/display : display.c
lib/filters : filter-composite.c filter-persistent.c
filter-regex.c filter.c
lib/format1 : disk-rep.c format1.c import-export.c
import-extents.c layout.c lvm1-label.c vg_number.c
lib/format_pool: disk_rep.c format_pool.c import_export.c lib/format_text: archive.c archiver.c export.c flags.c
format-text.c import.c import_vsn1.c tags.c
lib/label : label.c
lib/locking : external_locking.c
lib/metadata : lv_manip.c merge.c metadata.c mirror.c
pv_manip.c pv_map.c snapshot_manip.c
lib/mirror : mirrored.c
lib/report : report.c
lib/snapshot : snapshot.c
lib/striped : striped.c
lib/zero : zero.c
tools : lvchange.c lvconvert.c lvcreate.c lvmcmdline.c
lvresize.c pvchange.c pvmove.c pvresize.c toollib.c vgmerge.c vgreduce.c
Log message:
Use stack return macros throughout.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.782&r2=1.783
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.132&r2=1.133
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/btree.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-composite.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/layout.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/flags.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/tags.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/external_locking.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.147&r2=1.148
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.154&r2=1.155
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.90&r2=1.91
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvresize.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.128&r2=1.129
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.33 - =================================== + Use stack return macros throughout. Rely upon internally-cached PV labels while corresponding VG lock is held. Version 2.02.32 - 29th January 2008
lib/activate/dev_manager.c +21 -41
122 lines not on this page · raw message
lib/activate/fs.c +8 -16
@@ -175,10 +175,8 @@ }#ifdef HAVE_SELINUX -if (!dm_set_selinux_context (lv_path,S_IFLNK )) { - stack; -return 0 ; - } +if (!dm_set_selinux_context (lv_path,S_IFLNK )) + return_0;#endif return 1 ;
@@ -225,17 +223,13 @@switch (type) {case FS_ADD :if (!_mk_dir (dev_dir, vg_name) || - !_mk_link (dev_dir, vg_name, lv_name, dev)) { - stack; -return 0 ; - } + !_mk_link (dev_dir, vg_name, lv_name, dev)) + return_0;break ;case FS_DEL :if (!_rm_link (dev_dir, vg_name, lv_name) || - !_rm_dir (dev_dir, vg_name)) { - stack; -return 0 ; - } + !_rm_dir (dev_dir, vg_name)) + return_0;break ;/* FIXME Use rename() */ case FS_RENAME :
@@ -316,10 +310,8 @@ {if (memlock ()) {if (!_stack_fs_op (type, dev_dir, vg_name, lv_name, dev, - old_lv_name)) { - stack; -return 0 ; - } + old_lv_name)) + return_0;return 1 ; }
lib/cache/lvmcache.c +4 -8
@@ -803,10 +803,8 @@if (!(existing =info_from_pvid (pvid_s,0 )) && !(existing =info_from_pvid (dev->pvid,0 ))) { -if (!(label =label_create (labeller))) { - stack; -return NULL ; - } +if (!(label =label_create (labeller))) + return_NULL;if (!(info =dm_malloc (sizeof (*info)))) {log_error ("lvmcache_info allocation failed" );label_destroy (label);
@@ -862,11 +860,9 @@/* Has labeller changed? */ if (info->label->labeller != labeller) {label_destroy (info->label); -if (!(info->label =label_create (labeller))) { +if (!(info->label =label_create (labeller)))/* FIXME leaves info without label! */ - stack; -return NULL ; - } + return_NULL; info->label->info = info; } label = info->label;
lib/commands/toolcontext.c +16 -33
94 lines not on this page · raw message
lib/config/config.c +22 -44
127 lines not on this page · raw message
lib/datastruct/btree.c +2 -4
@@ -87,10 +87,8 @@struct node *p, **c =_lookup (&t->root, key, &p), *n;if (!*c) { -if (!(n =dm_pool_alloc (t->mem,sizeof (*n)))) { - stack; -return 0 ; - } +if (!(n =dm_pool_alloc (t->mem,sizeof (*n)))) + return_0; n->key = key; n->data = data;
lib/datastruct/str_list.c +8 -16
@@ -20,10 +20,8 @@ {struct list *sl; -if (!(sl =dm_pool_alloc (mem,sizeof (struct list )))) { - stack; -return NULL ; - } +if (!(sl =dm_pool_alloc (mem,sizeof (struct list )))) + return_NULL;list_init (sl);
@@ -34,19 +32,15 @@ {struct str_list *sln; -if (!str) { - stack; -return 0 ; - } +if (!str) + return_0;/* Already in list? */ if (str_list_match_item (sll, str))return 1 ; -if (!(sln =dm_pool_alloc (mem,sizeof (*sln)))) { - stack; -return 0 ; - } +if (!(sln =dm_pool_alloc (mem,sizeof (*sln)))) + return_0; sln->str = str;list_add (sll, &sln->list);
@@ -74,10 +68,8 @@list_init (sllnew); list_iterate_items(sl, sllold) { -if (!str_list_add (mem, sllnew,dm_pool_strdup (mem, sl->str))) { - stack; -return 0 ; - } +if (!str_list_add (mem, sllnew,dm_pool_strdup (mem, sl->str))) + return_0; }return 1 ;
lib/device/dev-cache.c +17 -34
97 lines not on this page · raw message
lib/device/dev-io.c +14 -28
84 lines not on this page · raw message
lib/device/device.c +2 -4
@@ -62,10 +62,8 @@return -1 ; } -if (!dev_read (dev,UINT64_C (0 ),sizeof (buf), &buf)) { - stack; - goto out; - } +if (!dev_read (dev,UINT64_C (0 ),sizeof (buf), &buf)) + goto_out;/* FIXME Check for other types of partition table too */
lib/display/display.c +4 -8
@@ -360,10 +360,8 @@if (!pv)return 0 ; -if (!id_write_format (&pv->id, uuid,sizeof (uuid))) { - stack; -return 0 ; - } +if (!id_write_format (&pv->id, uuid,sizeof (uuid))) + return_0;log_print ("PV Name %s " ,pv_dev_name (pv));/* FIXME pv->pv_number); */
@@ -407,10 +405,8 @@struct lv_segment *snap_seg =NULL ;float snap_percent;/* fused, fsize; */ -if (!id_write_format (&lv->lvid.id[1 ], uuid,sizeof (uuid))) { - stack; -return 0 ; - } +if (!id_write_format (&lv->lvid.id[1 ], uuid,sizeof (uuid))) + return_0; inkernel =lv_info (cmd, lv, &info,1 ,1 ) && info.exists;
lib/filters/filter-composite.c +2 -4
@@ -50,10 +50,8 @@ {struct dev_filter **filters_copy, *cft; -if (!filters) { - stack; -return NULL ; - } +if (!filters) + return_NULL;if (!(filters_copy =dm_malloc (sizeof (*filters) * (n +1 )))) {log_error ("composite filters allocation failed" );
lib/filters/filter-persistent.c +4 -8
@@ -42,10 +42,8 @@if (pf->devices)dm_hash_destroy (pf->devices); -if (!(pf->devices =dm_hash_create (128 ))) { - stack; -return 0 ; - } +if (!(pf->devices =dm_hash_create (128 ))) + return_0;return 1 ; }
@@ -293,10 +291,8 @@struct pfilter *pf;struct dev_filter *f =NULL ; -if (!(pf =dm_malloc (sizeof (*pf)))) { - stack; -return NULL ; - } +if (!(pf =dm_malloc (sizeof (*pf)))) + return_NULL;memset (pf,0 ,sizeof (*pf));if (!(pf->file =dm_malloc (strlen (file) +1 )))
lib/filters/filter-regex.c +4 -8
@@ -70,10 +70,8 @@/* * copy the regex */ -if (!(r =dm_pool_strdup (mem, pat))) { - stack; -return 0 ; - } +if (!(r =dm_pool_strdup (mem, pat))) + return_0;/* * trim the trailing character, having checked it's sep.
@@ -192,10 +190,8 @@struct rfilter *rf;struct dev_filter *f; -if (!mem) { - stack; -return NULL ; - } +if (!mem) + return_NULL;if (!(rf =dm_pool_alloc (mem,sizeof (*rf)))) goto_bad;
lib/filters/filter.c +1 -2
@@ -277,9 +277,8 @@ f->private =NULL ;if (!_scan_proc_dev (proc, cn)) { - stack;dm_free (f); -return NULL ; + return_NULL; }return f;
lib/format1/disk-rep.c +22 -29
157 lines not on this page · raw message
lib/format1/format1.c +32 -65
192 lines not on this page · raw message
lib/format1/import-export.c +44 -88
233 lines not on this page · raw message
lib/format1/import-extents.c +12 -24
@@ -118,10 +118,8 @@ e = dl->extents;/* build an array of lv's for this pv */ -if (!_fill_lv_array (lvms, maps, dl)) { - stack; -return 0 ; - } +if (!_fill_lv_array (lvms, maps, dl)) + return_0;for (i =0 ; i < dl->pvd.pe_total; i++) { lv_num = e[i].lv_num;
@@ -189,10 +187,8 @@for (n =dm_hash_get_first (maps); n; n =dm_hash_get_next (maps, n)) { lvm = (struct lv_map *)dm_hash_get_data (maps, n); -if (!_check_single_map (lvm)) { - stack; -return 0 ; - } +if (!_check_single_map (lvm)) + return_0; }return 1 ; }
@@ -216,10 +212,8 @@struct lv_segment *seg;struct segment_type *segtype; -if (!(segtype =get_segtype_from_string (cmd,"striped" ))) { - stack; -return 0 ; - } +if (!(segtype =get_segtype_from_string (cmd,"striped" ))) + return_0;while (le < lvm->lv->le_count) { len =_area_length (lvm, le);
@@ -334,10 +328,8 @@for (n =dm_hash_get_first (maps); n; n =dm_hash_get_next (maps, n)) { lvm = (struct lv_map *)dm_hash_get_data (maps, n); -if (!_build_segments (cmd, lvm)) { - stack; -return 0 ; - } +if (!_build_segments (cmd, lvm)) + return_0; }return 1 ;
@@ -350,10 +342,8 @@struct dm_pool *scratch =dm_pool_create ("lvm1 import_extents" ,10 *1024 );struct dm_hash_table *maps; -if (!scratch) { - stack; -return 0 ; - } +if (!scratch) + return_0;if (!(maps =_create_lv_maps (scratch, vg))) {log_err ("Couldn't allocate logical volume maps." );
@@ -365,10 +355,8 @@ goto out; } -if (!_check_maps_are_complete (maps) && !(vg->status &PARTIAL_VG )) { - stack; - goto out; - } +if (!_check_maps_are_complete (maps) && !(vg->status &PARTIAL_VG )) + goto_out;if (!_build_all_segments (cmd, maps)) {log_err ("Couldn't build extent segments." );
lib/format1/layout.c +2 -4
@@ -122,10 +122,8 @@struct pv_disk *pvd =dm_malloc (sizeof (*pvd));uint32_t end; -if (!pvd) { - stack; -return 0 ; - } +if (!pvd) + return_0;/* * Guess how many extents will fit, bearing in mind that
lib/format1/lvm1-label.c +2 -4
@@ -71,10 +71,8 @@ }if (!(info =lvmcache_add (l, (char *)pvd->pv_uuid, dev, (char *)pvd->vg_name, vgid, - exported))) { - stack; -return 0 ; - } + exported))) + return_0; *label = info->label; info->device_size =xlate32 (pvd->pv_size) <<SECTOR_SHIFT ;
lib/format1/vg_number.c +4 -8
@@ -33,15 +33,11 @@list_init (&all_pvs); -if (!mem) { - stack; -return 0 ; - } +if (!mem) + return_0; -if (!read_pvs_in_vg (fid->fmt,NULL , filter, mem, &all_pvs)) { - stack; - goto out; - } +if (!read_pvs_in_vg (fid->fmt,NULL , filter, mem, &all_pvs)) + goto_out;memset (numbers,0 ,sizeof (numbers));
lib/format_pool/disk_rep.c +10 -20
@@ -45,10 +45,8 @@return 0 ; } -if (!read_pool_label (pl, fmt->labeller, dev, buf,NULL )) { - stack; -return 0 ; - } +if (!read_pool_label (pl, fmt->labeller, dev, buf,NULL )) + return_0;return 1 ; }
@@ -98,10 +96,8 @@log_debug ("Calculated uuid %s for %s" , uuid, pd->pl_pool_name);if (!(info =lvmcache_add (l, (char *) &pvid, dev, pd->pl_pool_name, - (char *) &vgid,0 ))) { - stack; -return 0 ; - } + (char *) &vgid,0 ))) + return_0;if (label) *label = info->label;
@@ -252,10 +248,8 @@/* FIXME: maybe should return a different error in memory * allocation failure */ -if (!(tmpmem =dm_pool_create ("pool read_vg" ,512 ))) { - stack; -return 0 ; - } +if (!(tmpmem =dm_pool_create ("pool read_vg" ,512 ))) + return_0; list_iterate_items(info, &vginfo->infos) { if (info->dev &&
@@ -354,20 +348,16 @@ {struct pool_list *pl; -if (!dev_open (dev)) { - stack; -return NULL ; - } +if (!dev_open (dev)) + return_NULL;if (!(pl =dm_pool_zalloc (mem,sizeof (*pl)))) {log_error ("Unable to allocate pool list structure" );return 0 ; } -if (!__read_pool_disk (fmt, dev, mem, pl, vg_name)) { - stack; -return NULL ; - } +if (!__read_pool_disk (fmt, dev, mem, pl, vg_name)) + return_NULL;if (!dev_close (dev)) stack;
lib/format_pool/format_pool.c +26 -52
125 lines not on this page · raw message
lib/format_pool/import_export.c +16 -32
91 lines not on this page · raw message
lib/format_text/archive.c +13 -26
@@ -113,10 +113,8 @@ !dm_pool_grow_object (mem, dir,strlen (dir)) || !dm_pool_grow_object (mem,"/" ,1 ) || !dm_pool_grow_object (mem, name,strlen (name)) || - !dm_pool_grow_object(mem, "\0", 1)) { - stack; -return NULL ; - } + !dm_pool_grow_object(mem, "\0", 1)) + return_NULL;return dm_pool_end_object (mem); }
@@ -134,10 +132,8 @@struct archive_file *af;struct list *results; -if (!(results =dm_pool_alloc (mem,sizeof (*results)))) { - stack; -return NULL ; - } +if (!(results =dm_pool_alloc (mem,sizeof (*results)))) + return_NULL;list_init (results);
@@ -161,10 +157,8 @@if (strcmp (vgname, vgname_found))continue ; -if (!(path =_join_file_to_dir (mem, dir, dirent[i]->d_name))) { - stack; - goto out; - } +if (!(path =_join_file_to_dir (mem, dir, dirent[i]->d_name))) + goto_out;/* * Create a new archive_file.
@@ -255,10 +249,9 @@ }if (!text_vg_export_file (vg, desc, fp)) { - stack;if (fclose (fp))log_sys_error ("fclose" , temp_file); -return 0 ; + return_0; }if (lvm_fclose (fp, temp_file))
@@ -267,10 +260,8 @@/* * Now we want to rename this file to <vg>_index.vg. */ -if (!(archives =_scan_archive (vg->cmd->mem, vg->name, dir))) { - stack; -return 0 ; - } +if (!(archives =_scan_archive (vg->cmd->mem, vg->name, dir))) + return_0;if (list_empty (archives)) ix =0 ;
@@ -343,10 +334,8 @@struct list *archives;struct archive_file *af; -if (!(archives =_scan_archive (cmd->mem, vgname, dir))) { - stack; -return 0 ; - } +if (!(archives =_scan_archive (cmd->mem, vgname, dir))) + return_0;if (list_empty (archives))log_print ("No archives found in %s." , dir);
@@ -379,10 +368,8 @@ {struct archive_file af; -if (!(af.path =_join_file_to_dir (cmd->mem, dir, vgname))) { - stack; -return 0 ; - } +if (!(af.path =_join_file_to_dir (cmd->mem, dir, vgname))) + return_0;if (path_exists (af.path))_display_archive (cmd, &af);
lib/format_text/archiver.c +12 -24
@@ -78,17 +78,13 @@size_t len =strlen (line) +32 ;char *buffer; -if (!(buffer =dm_pool_zalloc (mem,strlen (line) +32 ))) { - stack; -return NULL ; - } +if (!(buffer =dm_pool_zalloc (mem,strlen (line) +32 ))) + return_NULL;if (snprintf (buffer, len,"Created %s executing '%s'" , - before ?"*before*" :"*after*" , line) <0 ) { - stack; -return NULL ; - } + before ?"*before*" :"*after*" , line) <0 ) + return_NULL;return buffer; }
@@ -97,10 +93,8 @@ {char *desc; -if (!(desc =_build_desc (vg->cmd->mem, vg->cmd->cmd_line,1 ))) { - stack; -return 0 ; - } +if (!(desc =_build_desc (vg->cmd->mem, vg->cmd->cmd_line,1 ))) + return_0; return archive_vg(vg, vg->cmd->archive_params->dir, desc, vg->cmd->archive_params->keep_days,
@@ -196,10 +190,8 @@char name[PATH_MAX ];char *desc; -if (!(desc =_build_desc (vg->cmd->mem, vg->cmd->cmd_line,0 ))) { - stack; -return 0 ; - } +if (!(desc =_build_desc (vg->cmd->mem, vg->cmd->cmd_line,0 ))) + return_0;if (dm_snprintf (name,sizeof (name),"%s/%s" , vg->cmd->backup_params->dir, vg->name) <0 ) {
@@ -324,10 +316,8 @@ } } -if (!vg_write (vg) || !vg_commit (vg)) { - stack; -return 0 ; - } +if (!vg_write (vg) || !vg_commit (vg)) + return_0;return 1 ; }
@@ -341,10 +331,8 @@/* * Read in the volume group from the text file. */ -if (!(vg =backup_read_vg (cmd, vg_name, file))) { - stack; -return 0 ; - } +if (!(vg =backup_read_vg (cmd, vg_name, file))) + return_0;return backup_restore_vg (cmd, vg); }
lib/format_text/export.c +53 -106
290 lines not on this page · raw message
lib/format_text/flags.c +4 -8
@@ -91,10 +91,8 @@int f, first =1 ;struct flag *flags; -if (!(flags =_get_flags (type))) { - stack; -return 0 ; - } +if (!(flags =_get_flags (type))) + return_0;if (!emit_to_buffer (&buffer, &size,"[" ))return 0 ;
@@ -135,10 +133,8 @@uint32_t s =0 ;struct flag *flags; -if (!(flags =_get_flags (type))) { - stack; -return 0 ; - } +if (!(flags =_get_flags (type))) + return_0;if (cv->type ==CFG_EMPTY_ARRAY ) goto out;
lib/format_text/format-text.c +86 -164
478 lines not on this page · raw message
lib/format_text/import.c +2 -4
@@ -111,10 +111,8 @@if (!(*vsn)->check_version (cft))continue ; -if (!(vg = (*vsn)->read_vg (fid, cft))) { - stack; - goto out; - } +if (!(vg = (*vsn)->read_vg (fid, cft))) + goto_out; (*vsn)->read_desc (fid->fmt->cmd->mem, cft, when, desc);break ;
lib/format_text/import_vsn1.c +36 -72
207 lines not on this page · raw message
lib/format_text/tags.c +10 -20
@@ -24,30 +24,22 @@struct str_list *sl;int first =1 ; -if (!emit_to_buffer (&buffer, &size,"[" )) { - stack; -return 0 ; - } +if (!emit_to_buffer (&buffer, &size,"[" )) + return_0; list_iterate_items(sl, tags) {if (!first) { -if (!emit_to_buffer (&buffer, &size,", " )) { - stack; -return 0 ; - } +if (!emit_to_buffer (&buffer, &size,", " )) + return_0; }else first =0 ; -if (!emit_to_buffer (&buffer, &size,"\"%s\"" , sl->str)) { - stack; -return 0 ; - } +if (!emit_to_buffer (&buffer, &size,"\"%s\"" , sl->str)) + return_0; } -if (!emit_to_buffer (&buffer, &size,"]" )) { - stack; -return 0 ; - } +if (!emit_to_buffer (&buffer, &size,"]" )) + return_0;return 1 ; }
@@ -63,10 +55,8 @@return 0 ; } -if (!str_list_add (mem, tags,dm_pool_strdup (mem, cv->v.str))) { - stack; -return 0 ; - } +if (!str_list_add (mem, tags,dm_pool_strdup (mem, cv->v.str))) + return_0; cv = cv->next; }
lib/label/label.c +8 -16
@@ -86,10 +86,8 @@ {struct labeller_i *li; -if (!(li =_alloc_li (name, handler))) { - stack; -return 0 ; - } +if (!(li =_alloc_li (name, handler))) + return_0;list_add (&_labellers, &li->list);return 1 ;
@@ -203,10 +201,8 @@log_very_verbose ("Scanning for labels to wipe from %s" ,dev_name (dev)); -if (!dev_open (dev)) { - stack; -return 0 ; - } +if (!dev_open (dev)) + return_0;/* * We flush the device just in case someone is stupid
@@ -322,18 +318,14 @@ lh->sector_xl =xlate64 (label->sector); lh->offset_xl =xlate32 (sizeof (*lh)); -if (!(label->labeller->ops->write)(label, buf)) { - stack; -return 0 ; - } +if (!(label->labeller->ops->write)(label, buf)) + return_0; lh->crc_xl =xlate32 (calc_crc (INITIAL_CRC , &lh->offset_xl,LABEL_SIZE - ((void *) &lh->offset_xl - (void *) lh))); -if (!dev_open (dev)) { - stack; -return 0 ; - } +if (!dev_open (dev)) + return_0;log_info ("%s: Writing label to sector %" PRIu64,dev_name (dev), label->sector);
lib/locking/external_locking.c +2 -4
@@ -73,10 +73,8 @@ libname =find_config_tree_str (cmd,"global/locking_library" ,DEFAULT_LOCKING_LIB );
Lines of this file are not shown. View the raw message.
lib/metadata/lv_manip.c +42 -84
126 lines not on this page · raw message
lib/metadata/merge.c +6 -12
Lines of this file are not shown. View the raw message.
lib/metadata/metadata.c +66 -132
198 lines not on this page · raw message
lib/metadata/mirror.c +2 -4
Lines of this file are not shown. View the raw message.
lib/metadata/pv_manip.c +14 -28
42 lines not on this page · raw message
lib/metadata/pv_map.c +12 -24
Lines of this file are not shown. View the raw message.
lib/metadata/snapshot_manip.c +4 -8
Lines of this file are not shown. View the raw message.
lib/mirror/mirrored.c +2 -4
Lines of this file are not shown. View the raw message.
lib/report/report.c +6 -12
Lines of this file are not shown. View the raw message.
lib/snapshot/snapshot.c +4 -8
Lines of this file are not shown. View the raw message.
lib/striped/striped.c +2 -4
Lines of this file are not shown. View the raw message.
lib/zero/zero.c +2 -4
Lines of this file are not shown. View the raw message.
tools/lvchange.c +26 -52
78 lines not on this page · raw message
tools/lvconvert.c +4 -6
Lines of this file are not shown. View the raw message.
tools/lvcreate.c +15 -32
47 lines not on this page · raw message
tools/lvmcmdline.c +2 -4
Lines of this file are not shown. View the raw message.
tools/lvresize.c +7 -13
Lines of this file are not shown. View the raw message.
tools/pvchange.c +1 -2
Lines of this file are not shown. View the raw message.
tools/pvmove.c +11 -20
Lines of this file are not shown. View the raw message.
tools/pvresize.c +1 -2
Lines of this file are not shown. View the raw message.
tools/toollib.c +10 -20
Lines of this file are not shown. View the raw message.
tools/vgmerge.c +8 -11
Lines of this file are not shown. View the raw message.
tools/vgreduce.c +17 -34
51 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.