summaryrefslogtreecommitdiffstats
path: root/lib/label/label.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2008-01-30 13:19:47 +0000
committerAlasdair Kergon <agk@redhat.com>2008-01-30 13:19:47 +0000
commitc51b9fff19d4891addf22f35950eeae48be9cac8 (patch)
treea2bdcb2e7b6828e82fe894bb4a6a8b6125d0cebc /lib/label/label.c
parent962b2a559dde931e5e519706b755bf2764b8338a (diff)
downloadlvm2-c51b9fff19d4891addf22f35950eeae48be9cac8.tar.gz
lvm2-c51b9fff19d4891addf22f35950eeae48be9cac8.tar.xz
lvm2-c51b9fff19d4891addf22f35950eeae48be9cac8.zip
Use stack return macros throughout.
Diffstat (limited to 'lib/label/label.c')
-rw-r--r--lib/label/label.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index e0454d01..7ba586ae 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -86,10 +86,8 @@ int label_register_handler(const char *name, struct labeller *handler)
{
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 @@ int label_remove(struct device *dev)
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 @@ int label_write(struct device *dev, struct label *label)
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);