[sheepdog] [PATCH 1/3] sheep: introduce ec_max_data_strip

Liu Yuan namei.unix at gmail.com
Sat Oct 26 13:16:18 CEST 2013


On Sat, Oct 26, 2013 at 03:10:55AM +0900, MORITA Kazutaka wrote:
> At Wed, 23 Oct 2013 15:59:11 +0800,
> Liu Yuan wrote:
> > 
> > This is a preparation patch
> > 
> > Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> > ---
> >  sheep/ops.c        |    3 ++-
> >  sheep/sheep_priv.h |    1 +
> >  sheep/vdi.c        |   14 ++++++++++++++
> >  3 files changed, 17 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sheep/ops.c b/sheep/ops.c
> > index 7f73ab1..d8c652b 100644
> > --- a/sheep/ops.c
> > +++ b/sheep/ops.c
> > @@ -676,7 +676,8 @@ static int cluster_recovery_completion(const struct sd_req *req,
> >  			sd_debug("all nodes are recovered, epoch %d", epoch);
> >  			last_gathered_epoch = epoch;
> >  			/* sd_store can be NULL if this node is a gateway */
> > -			if (sd_store && sd_store->cleanup)
> > +			if (vnode_info->nr_zones >= ec_max_data_strip &&
> > +			    sd_store && sd_store->cleanup)
> >  				sd_store->cleanup();
> >  		}
> >  	}
> > diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
> > index 615d912..0c44651 100644
> > --- a/sheep/sheep_priv.h
> > +++ b/sheep/sheep_priv.h
> > @@ -296,6 +296,7 @@ int vdi_snapshot(const struct vdi_iocb *iocb, uint32_t *new_vid);
> >  int vdi_delete(const struct vdi_iocb *iocb, struct request *req);
> >  int vdi_lookup(const struct vdi_iocb *iocb, struct vdi_info *info);
> >  void clean_vdi_state(void);
> > +extern int ec_max_data_strip;
> >  
> >  int read_vdis(char *data, int len, unsigned int *rsp_len);
> >  
> > diff --git a/sheep/vdi.c b/sheep/vdi.c
> > index 221905d..3b39247 100644
> > --- a/sheep/vdi.c
> > +++ b/sheep/vdi.c
> > @@ -22,6 +22,13 @@ struct vdi_state_entry {
> >  static struct rb_root vdi_state_root = RB_ROOT;
> >  static struct sd_lock vdi_state_lock = SD_LOCK_INITIALIZER;
> >  
> > +/*
> > + * ec_max_data_strip represent max number of data strips in the cluster. When
> > + * nr_zones < it, we don't purge the stale objects because for erasure coding,
> > + * there is only one copy of data.
> > + */
> > +int ec_max_data_strip;
> > +
> 
> s/strip/stripe/ ?

No, this is the max number of data strips in the stripe of all the scheme
(it is x in the x:y)

Thanks
Yuan



More information about the sheepdog mailing list