All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 03/12] Add id_format_and_copy() uuid function to allocate and format a uuid.
Date: Fri, 10 Sep 2010 12:56:28 -0400	[thread overview]
Message-ID: <1284137788.5096.1.camel@localhost.localdomain> (raw)
In-Reply-To: <4C89FAC4.5000103@redhat.com>

On Fri, 2010-09-10 at 11:30 +0200, Zdenek Kabelac wrote:
> Dne 9.9.2010 22:13, Dave Wysochanski napsal(a):
> > Add supporting uuid function to allocate memory and call id_write_format.
> > Will be used from reporting functions as well as property functions.
> > 
> > Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
> > ---
> >  lib/uuid/uuid.c |   15 +++++++++++++++
> >  lib/uuid/uuid.h |    2 ++
> >  2 files changed, 17 insertions(+), 0 deletions(-)
> > 
> > diff --git a/lib/uuid/uuid.c b/lib/uuid/uuid.c
> > index de3f0cd..6608473 100644
> > --- a/lib/uuid/uuid.c
> > +++ b/lib/uuid/uuid.c
> > @@ -206,3 +206,18 @@ int id_read_format(struct id *id, const char *buffer)
> >  
> >  	return id_valid(id);
> >  }
> > +
> > +char *id_format_and_copy(struct dm_pool *mem, 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;
> > +}
> > diff --git a/lib/uuid/uuid.h b/lib/uuid/uuid.h
> > index 0029639..6c1169a 100644
> > --- a/lib/uuid/uuid.h
> > +++ b/lib/uuid/uuid.h
> > @@ -54,4 +54,6 @@ int id_write_format(const struct id *id, char *buffer, size_t size);
> >   */
> >  int id_read_format(struct id *id, const char *buffer);
> >  
> > +char *id_format_and_copy(struct dm_pool *mem, struct id *id);
> 
> const struct id*
> 
> Please consider 'const' in case you do not plane to modify id inside this
> function.
> 
> Zdenek
> 

Updated in my patchset.



  reply	other threads:[~2010-09-10 16:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 20:12 [PATCH 00/12] Add lvm vg properties for lvm2app Dave Wysochanski
2010-09-09 20:12 ` [PATCH 01/12] Add vg_attr() and lv_attr() functions Dave Wysochanski
2010-09-10  9:28   ` Zdenek Kabelac
2010-09-10 16:54     ` [PATCH] Simplify logic to create 'attr' strings Dave Wysochanski
2010-09-09 20:12 ` [PATCH 02/12] Refactor pvstatus_disp to take pv argument and call common pv_attr function Dave Wysochanski
2010-09-09 20:13 ` [PATCH 03/12] Add id_format_and_copy() uuid function to allocate and format a uuid Dave Wysochanski
2010-09-10  9:30   ` Zdenek Kabelac
2010-09-10 16:56     ` Dave Wysochanski [this message]
2010-09-09 20:13 ` [PATCH 04/12] Call id_format_and_copy from _uuid_disp Dave Wysochanski
2010-09-09 20:13 ` [PATCH 05/12] Add pv_uuid, vg_uuid, and lv_uuid, and call id_format_and_copy Dave Wysochanski
2010-09-10  9:38   ` Zdenek Kabelac
2010-09-10 17:25     ` Dave Wysochanski
2010-09-09 20:13 ` [PATCH 06/12] Add tags_format_and_copy() common function to format tags strings Dave Wysochanski
2010-09-09 20:13 ` [PATCH 07/12] Add pv_tags, vg_tags, lv_tags functions that call tags_format_and_copy Dave Wysochanski
2010-09-09 20:13 ` [PATCH 08/12] Add GET_STR_PROPERTY_FN macro Dave Wysochanski
2010-09-09 20:13 ` [PATCH 09/12] Add 'get' functions for a few vg string fields, vg_name, vg_fmt, vg_sysid Dave Wysochanski
2010-09-09 20:13 ` [PATCH 10/12] Add vg_uuid, vg_attr, vg_tags 'get' functions Dave Wysochanski
2010-09-09 20:13 ` [PATCH 11/12] Add lvm_vg_get_property() generic vg property function Dave Wysochanski
2010-09-09 20:13 ` [PATCH 12/12] Add tests for lvm_vg_get_property() Dave Wysochanski

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=1284137788.5096.1.camel@localhost.localdomain \
    --to=dwysocha@redhat.com \
    --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.