[PATCH 07/14] Refactor and add code for (lv) 'mirror_log' get function.

Dave Wysochanski <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <1286897328.24741.0.camel@f12-work>
On Mon, 2010-10-11 at 20:29 +0200, Petr Rockai wrote:
> Dave Wysochanski <[email protected]> writes:
> 
> > Signed-off-by: Dave Wysochanski <[email protected]>
> Reviewed-By: Petr Rockai <[email protected]>
> 
> > +		name = seg->log_lv->name;
> > +	}
> > +	if (name)
> > +		return dm_pool_strndup(mem, name, strlen(name) + 1);
> > +	return NULL;
> > +}
> strndup & unnecessary temporary again
> 

Fixed.

> > -		if (!seg_is_mirrored(seg) || !seg->log_lv)
> > -			continue;
> > -		return dm_report_field_string(rh, field,
> > -					      (const char **) &seg->log_lv->name);
> > -	}
> > +	name = lv_mirror_log_dup(mem, lv);
> > +	if (name)
> > +		return dm_report_field_string(rh, field, &name);
> >  
> >  	dm_report_field_set_value(field, "", NULL);
> >  	return 1;
> 
> OK. Your other patches use if ((name = ...)) style, maybe use it here as
> well? (Or change the others to use this style instead?)
> 

Done.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.