[sheepdog] [PATCH 2/9] sheep: clean up log_current_epoch call

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Jul 11 09:11:13 CEST 2013


At Thu, 11 Jul 2013 14:39:15 +0800,
Liu Yuan wrote:
> 
> On Thu, Jul 11, 2013 at 01:33:58PM +0900, MORITA Kazutaka wrote:
> > From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> > 
> > This moves epoch incrementation into log_current_epoch() to simplify
> > codes, and adds a check of the return value of the function.
> > 
> > Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
> > ---
> >  sheep/group.c |   40 ++++++++++++++++++++++++----------------
> >  sheep/ops.c   |    3 +--
> >  2 files changed, 25 insertions(+), 18 deletions(-)
> > 
> > diff --git a/sheep/group.c b/sheep/group.c
> > index 473c8d8..0043929 100644
> > --- a/sheep/group.c
> > +++ b/sheep/group.c
> > @@ -590,15 +590,18 @@ int log_current_epoch(void)
> 
> Then it is better to name it as log_and_inc_epoch

We increment an epoch before writing it, so inc_and_log_epoch() looks
better.

Thanks,

Kazutaka



More information about the sheepdog mailing list