[sheepdog] [PATCH 1/2] sheep : add new strage type "tree"

Hitoshi Mitake mitake.hitoshi at gmail.com
Thu Mar 12 12:43:38 CET 2015


At Thu, 12 Mar 2015 13:50:26 +0900,
Saeki Masaki wrote:
> 
> Current sheepdog stores whole objects in single directory like "/var/lib/sheepdog/obj"
> This mechanism is difficult to handle massive files when increasing cluster volume.
> 
> In particular, inode object having special informations about VDI,
> so it is preferable to divide.
> 
> new storage type named "tree"
> It separates the inode object and data object.
> 
> How to use ,
> specify the --store option at the time format
> 
> dog cluster format --store tree
> 
> Signed-off-by: Masaki Saeki <saeki.masaki at po.ntts.co.jp>
> ---
>  sheep/Makefile.am  |    2 +-
>  sheep/md.c         |   14 +
>  sheep/sheep_priv.h |   13 +
>  sheep/tree_store.c |  844 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 872 insertions(+), 1 deletions(-)
>  create mode 100644 sheep/tree_store.c
> 
> diff --git a/sheep/Makefile.am b/sheep/Makefile.am
> index 7a08838..c6b7441 100644
> --- a/sheep/Makefile.am
> +++ b/sheep/Makefile.am
> @@ -27,7 +27,7 @@ sbin_PROGRAMS		= sheep
>  sheep_SOURCES		= sheep.c group.c request.c gateway.c store.c vdi.c \
>  			  journal.c ops.c recovery.c cluster/local.c \
>  			  object_cache.c object_list_cache.c \
> -			  plain_store.c config.c migrate.c md.c
> +			  plain_store.c tree_store.c config.c migrate.c md.c
>  
>  if BUILD_HTTP
>  sheep_SOURCES		+= http/http.c http/kv.c http/s3.c http/swift.c \
> diff --git a/sheep/md.c b/sheep/md.c
> index c00d7a5..7aca7c0 100644
> --- a/sheep/md.c
> +++ b/sheep/md.c
> @@ -212,6 +212,20 @@ static int for_each_object_in_path(const char *path,
>  		if (unlikely(!strncmp(d->d_name, ".", 1)))
>  			continue;
>  
> +		/* recursive call for tree store driver sub directories*/
> +		if (check_store_name("tree")) {

Providing numerical ID for store drivers with enum would be better
e.g. check_store_type(numerical ID). It can be implemented easily to
add a new enum type and add a new member to store driver struct.


> diff --git a/sheep/tree_store.c b/sheep/tree_store.c
> new file mode 100644
> index 0000000..7402f42
> --- /dev/null
> +++ b/sheep/tree_store.c
> @@ -0,0 +1,844 @@
> +/*
> + * Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.

Copyright year :)

> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License version
> + * 2 as published by the Free Software Foundation.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
> + */

Other part looks good to me.

Thanks,
Hitoshi



More information about the sheepdog mailing list