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

Dave Wysochanski dwysocha at redhat.com
Tue Oct 12 15:28:48 UTC 2010


On Mon, 2010-10-11 at 20:29 +0200, Petr Rockai wrote:
> Dave Wysochanski <dwysocha at redhat.com> writes:
> 
> > Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
> Reviewed-By: Petr Rockai <prockai at redhat.com>
> 
> > +		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.




More information about the lvm-devel mailing list