[sheepdog] [PATCH RFC 2/2] collie: add a new subcommand "recovery-progress" to node

Hitoshi Mitake mitake.hitoshi at gmail.com
Thu Aug 1 05:03:20 CEST 2013


At Mon, 29 Jul 2013 16:13:27 +0800,
Liu Yuan wrote:
> 
> On Mon, Jul 29, 2013 at 04:39:27PM +0900, Hitoshi Mitake wrote:
> > This patch adds a new subcommand recovery-progress to node. With this
> > subcommand, users can show a progress of recovery process.
> > 
> > $ sudo collie node recovery-progress
> >  99.7 % [==============================================>] 7047 / 7068
> > recovery process ends
> > 
> > The denominator (7068 in the above case) indicates a number of entire
> > object which should be checked. The numerator (7047 in the above case)
> > indicates a number of objects which is already checked or copied.
> > 
> > Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> > ---
> >  collie/node.c |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 81 insertions(+), 1 deletion(-)
> > 
> > diff --git a/collie/node.c b/collie/node.c
> > index 0cd7e7a..2019c3e 100644
> > --- a/collie/node.c
> > +++ b/collie/node.c
> > @@ -120,6 +120,84 @@ static int node_info(int argc, char **argv)
> >  	return EXIT_SUCCESS;
> >  }
> >  
> > +/*
> > + * recovery_progress_unit()
> > + *
> > + * Obtain recovery progress information and return true if the recovery process
> > + * ends.
> > + */
> > +static bool recovery_progress_unit(struct recovery_progress *prog)
> > +{
> > +	int ret;
> > +	bool res = false;
> 
> what does res mean? We mostly use 'ret' to mean 'return value' conventionally.
> 
> And I think get_recovery_info() is a better name.

I'll rename the function as get_recovery_progress(). Because the name
recovery_info is used for other data structure, get_recovery_info()
would be confusing.

Thanks,
Hitoshi



More information about the sheepdog mailing list