From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/libdm libdm-deptree.c
Date: 22 Sep 2009 16:26:59 -0000 [thread overview]
Message-ID: <20090922162659.5217.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2009-09-22 16:26:59
Modified files:
libdm : libdm-deptree.c
Log message:
'_emit_areas_line' returns 1 for success and 0 for failure. This always
confuses me, so I've added a comment at the top of the function to
remind me of this.
I also found that 'mirror_emit_segment_line' was returning 0 (return_0)
on failure /and/ success. It now returns 1 for success and 0 for failure -
just like '_emit_areas_line' and its calling function, '_emit_segment_line'.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
--- LVM2/libdm/libdm-deptree.c 2009/08/13 16:31:01 1.56
+++ LVM2/libdm/libdm-deptree.c 2009/09/22 16:26:59 1.57
@@ -1258,6 +1258,11 @@
p += w;\
} while (0)
+/*
+ * _emit_areas_line
+ *
+ * Returns: 1 on success, 0 on failure
+ */
static int _emit_areas_line(struct dm_task *dmt __attribute((unused)),
struct load_segment *seg, char *params,
size_t paramsize, int *pos)
@@ -1279,6 +1284,11 @@
return 1;
}
+/*
+ * mirror_emit_segment_line
+ *
+ * Returns: 1 on success, 0 on failure
+ */
static int mirror_emit_segment_line(struct dm_task *dmt, uint32_t major,
uint32_t minor, struct load_segment *seg,
uint64_t *seg_start, char *params,
@@ -1386,15 +1396,13 @@
EMIT_PARAMS(pos, " %u ", seg->mirror_area_count);
- if ((r = _emit_areas_line(dmt, seg, params, paramsize, &pos)) <= 0) {
- stack;
- return r;
- }
+ if ((r = _emit_areas_line(dmt, seg, params, paramsize, &pos)) <= 0)
+ return_0;
if (handle_errors)
EMIT_PARAMS(pos, " 1 handle_errors");
- return 0;
+ return 1;
}
static int _emit_segment_line(struct dm_task *dmt, uint32_t major,
@@ -1415,8 +1423,8 @@
/* Mirrors are pretty complicated - now in separate function */
r = mirror_emit_segment_line(dmt, major, minor, seg, seg_start,
params, paramsize);
- if (r)
- return r;
+ if (!r)
+ return_0;
break;
case SEG_SNAPSHOT:
if (!_build_dev_string(originbuf, sizeof(originbuf), seg->origin))
next reply other threads:[~2009-09-22 16:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-22 16:26 jbrassow [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-15 20:03 LVM2/libdm libdm-deptree.c agk
2012-05-15 14:10 agk
2012-03-04 16:05 zkabelac
2012-03-02 21:53 zkabelac
2012-01-25 8:46 zkabelac
2012-01-19 15:22 zkabelac
2011-11-04 12:39 zkabelac
2011-10-30 22:04 zkabelac
2011-10-28 20:11 zkabelac
2011-10-20 10:39 zkabelac
2011-10-20 10:35 zkabelac
2011-10-19 16:45 zkabelac
2011-10-19 16:40 zkabelac
2011-10-17 14:15 zkabelac
2011-10-17 14:14 zkabelac
2011-10-03 18:29 zkabelac
2011-09-29 8:50 zkabelac
2011-07-08 19:13 agk
2011-06-22 12:56 prajnoha
2011-06-11 12:55 agk
2011-06-09 15:53 mbroz
2010-11-29 12:42 zkabelac
2010-11-29 11:26 zkabelac
2010-05-25 8:40 zkabelac
2010-04-07 23:51 agk
2010-04-07 21:25 agk
2010-01-15 16:00 jbrassow
2010-01-05 21:06 snitzer
2010-01-05 21:05 snitzer
2010-01-05 21:04 snitzer
2009-07-07 16:36 agk
2008-12-12 18:45 agk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090922162659.5217.qmail@sourceware.org \
--to=jbrassow@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.