[sheepdog] [PATCH v5 15/16] collie: implement "collie cluster snapshot" subcommand

MORITA Kazutaka morita.kazutaka at gmail.com
Mon May 20 21:05:36 CEST 2013


At Mon, 20 May 2013 15:50:45 +0800,
Kai Zhang wrote:
> diff --git a/collie/cluster.c b/collie/cluster.c
> index 82a9015..ba02ab5 100644
> --- a/collie/cluster.c
> +++ b/collie/cluster.c
> @@ -15,6 +15,7 @@
>  #include <sys/time.h>
>  
>  #include "collie.h"
> +#include "farm/farm.h"
>  
>  static struct sd_option cluster_options[] = {
>  	{'b', "store", true, "specify backend store"},
> @@ -219,6 +220,144 @@ static int cluster_shutdown(int argc, char **argv)
>  	return EXIT_SUCCESS;
>  }
>  
> +static void print_list(void *buf, unsigned len)
> +{
> +	struct snap_log *log_buf = (struct snap_log *)buf;
> +	unsigned nr = len / sizeof(struct snap_log), i;
> +
> +	printf("Index\t\tTag\t\tSnapshot Time\n");
> +	for (i = 0; i < nr; i++, log_buf++) {

I prefer

  for (int i = 0; i < nr; i++, log_buf++) {

to make the scope of the variable narrower.

Thanks,

Kazutaka



More information about the sheepdog mailing list