[sheepdog] [PATCH 3/5] sheep: use stored nr_copies and flags

Christoph Hellwig hch at infradead.org
Thu Jul 19 09:02:17 CEST 2012


On Thu, Jul 19, 2012 at 02:40:33PM +0800, Liu Yuan wrote:
> On 07/18/2012 07:41 PM, Christoph Hellwig wrote:
> >  		/* Fresh node */
> > -		if (!sys_stat_ok() && !sys_stat_halt()) {
> > +		if (sys->status == SD_STATUS_WAIT_FOR_FORMAT) {
> 
> There is a helper sys_stat_wait_format() for SD_STATUS_WAIT_FOR_FORMAT.

I really don't like these helpers as they obsfucate what's going on.
That's also related to trying to use switch statements handling all
the cases explicitly in many places in the join code.

> Also I am not sure if we can change fresh node check into
> SD_STATUS_WAIT_FOR_FORMAT. Is there possible for a fresh node with
> SD_STATUS_WAIT_FOR_JOIN?

All nodes that do not have an epoch log entry yet are set to
SD_STATUS_WAIT_FOR_FORMAT state during startup.



More information about the sheepdog mailing list