[sheepdog] [PATCH v2 04/11] collie: fix 'node info'

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon May 27 10:08:05 CEST 2013


At Mon, 27 May 2013 14:22:56 +0800,
Liu Yuan wrote:
> 
> @@ -673,3 +673,16 @@ int md_unplug_disks(char *disks)
>  {
>  	return do_plug_unplug(disks, false);
>  }
> +
> +uint64_t md_get_size(uint64_t *used)
> +{
> +	uint64_t fsize = 0;
> +	*used = 0;
> +
> +	pthread_rwlock_rdlock(&md_lock);
> +	for (int i = 0; i < md_nr_disks; i++)
> +		fsize += get_path_free_size(md_disks[i].path, used);
> +	pthread_rwlock_unlock(&md_lock);
> +
> +	return fsize + *used;
> +}

This doesn't calculate the correct total size when the underlying
store doesn't support fallocate (e.g. ext3).

How about merging the below patch before this series to calculate the
correct used size?  The patch can be applied independently.

http://lists.wpkg.org/pipermail/sheepdog/2013-May/009512.html

Thanks,

Kazutaka



More information about the sheepdog mailing list