Message ID | 1454639122-14027-1-git-send-email-xiecl.fnst@cn.fujitsu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri 05 Feb 2016 03:25:22 AM CET, Changlong Xie <xiecl.fnst@cn.fujitsu.com> wrote: > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> > Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Berto
On 02/04/2016 07:25 PM, Changlong Xie wrote: > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> > Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> > --- > block/quorum.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/block/quorum.c b/block/quorum.c > index a5ae4b8..11cc60b 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -286,7 +286,8 @@ static void quorum_aio_cb(void *opaque, int ret) > > if (acb->is_read && s->read_pattern == QUORUM_READ_PATTERN_FIFO) { > /* We try to read next child in FIFO order if we fail to read */ > - if (ret < 0 && ++acb->child_iter < s->num_children) { > + if (ret < 0 && (acb->child_iter + 1) < s->num_children) { Could shorten this as if (ret < 0 && acb->child_iter <= s->num_children) { but I'm not sure it's worth the mental gymnastics.
Am 05.02.2016 um 14:28 hat Alberto Garcia geschrieben: > On Fri 05 Feb 2016 03:25:22 AM CET, Changlong Xie <xiecl.fnst@cn.fujitsu.com> wrote: > > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> > > Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> > > Reviewed-by: Alberto Garcia <berto@igalia.com> Thanks, applied to the block branch. Kevin
On 02/05/2016 11:46 PM, Eric Blake wrote: > On 02/04/2016 07:25 PM, Changlong Xie wrote: >> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> >> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> >> --- >> block/quorum.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/block/quorum.c b/block/quorum.c >> index a5ae4b8..11cc60b 100644 >> --- a/block/quorum.c >> +++ b/block/quorum.c >> @@ -286,7 +286,8 @@ static void quorum_aio_cb(void *opaque, int ret) >> >> if (acb->is_read && s->read_pattern == QUORUM_READ_PATTERN_FIFO) { >> /* We try to read next child in FIFO order if we fail to read */ >> - if (ret < 0 && ++acb->child_iter < s->num_children) { >> + if (ret < 0 && (acb->child_iter + 1) < s->num_children) { > > Could shorten this as > if (ret < 0 && acb->child_iter <= s->num_children) { > but I'm not sure it's worth the mental gymnastics. Hi Eric Just the same to me. Since it has been applied to block branch. Let's keep the original one. Thanks -Xie >
diff --git a/block/quorum.c b/block/quorum.c index a5ae4b8..11cc60b 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -286,7 +286,8 @@ static void quorum_aio_cb(void *opaque, int ret) if (acb->is_read && s->read_pattern == QUORUM_READ_PATTERN_FIFO) { /* We try to read next child in FIFO order if we fail to read */ - if (ret < 0 && ++acb->child_iter < s->num_children) { + if (ret < 0 && (acb->child_iter + 1) < s->num_children) { + acb->child_iter++; read_fifo_child(acb); return; }