[dm-devel] 答复: Re: [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

Martin Wilck mwilck at suse.com
Fri Feb 17 11:40:14 UTC 2017


On Fri, 2017-02-17 at 11:24 +0800, tang.junhui at zte.com.cn wrote:
> Hello Martin,
> 
> Thanks for your responsible,
> 
> > I'd like the following better for this check. It uses much less cyc
> les.
> 
> >  static bool
> > can_discard_by_devpath(const char *devpath)
> 
> > This would be better readable and faster if you'd put the "kernel"
> > tests first so that you need to check only "action" later:
> 
> >     if (!strncmp(later->kernel, "dm-", 3) ||
> >        strcmp(earlier->kernel, later->kernel))
> >        return false;
> 
> Yes, I think these codes can be reworked, but since they have no
> logical
> effect, and this patch takes too long time, can you commit a new
> patch 
> to rework these codes?

Yes, I could do that.

Regards
Martin

-- 
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)




More information about the dm-devel mailing list