From: wysochanski@sourceware.org <wysochanski@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/lib report/report.c uuid/uuid.c uuid/uuid.h
Date: 30 Sep 2010 14:07:34 -0000 [thread overview]
Message-ID: <20100930140734.16135.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2010-09-30 14:07:34
Modified files:
lib/report : report.c
lib/uuid : uuid.c uuid.h
Log message:
Add id_format_and_copy() common function and call from _uuid_disp.
Add supporting uuid function to allocate memory and call id_write_format.
Call id_format_and_copy from _uuid_disp.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.128&r2=1.129
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/uuid/uuid.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/uuid/uuid.h.diff?cvsroot=lvm2&r1=1.16&r2=1.17
--- LVM2/lib/report/report.c 2010/09/30 13:52:57 1.128
+++ LVM2/lib/report/report.c 2010/09/30 14:07:33 1.129
@@ -677,12 +677,7 @@
{
char *repstr = NULL;
- if (!(repstr = dm_pool_alloc(mem, 40))) {
- log_error("dm_pool_alloc failed");
- return 0;
- }
-
- if (!id_write_format((const struct id *) data, repstr, 40))
+ if (!(repstr = id_format_and_copy(mem, (struct id *)data)))
return_0;
dm_report_field_set_value(field, repstr, NULL);
--- LVM2/lib/uuid/uuid.c 2009/07/15 20:02:47 1.30
+++ LVM2/lib/uuid/uuid.c 2010/09/30 14:07:33 1.31
@@ -206,3 +206,18 @@
return id_valid(id);
}
+
+char *id_format_and_copy(struct dm_pool *mem, const struct id *id)
+{
+ char *repstr = NULL;
+
+ if (!(repstr = dm_pool_alloc(mem, 40))) {
+ log_error("dm_pool_alloc failed");
+ return NULL;
+ }
+
+ if (!id_write_format(id, repstr, 40))
+ return_NULL;
+
+ return repstr;
+}
--- LVM2/lib/uuid/uuid.h 2008/08/28 18:41:51 1.16
+++ LVM2/lib/uuid/uuid.h 2010/09/30 14:07:33 1.17
@@ -54,4 +54,6 @@
*/
int id_read_format(struct id *id, const char *buffer);
+char *id_format_and_copy(struct dm_pool *mem, const struct id *id);
+
#endif
reply other threads:[~2010-09-30 14:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100930140734.16135.qmail@sourceware.org \
--to=wysochanski@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.