[sheepdog-users] dead code?

Dietmar Maurer dietmar at proxmox.com
Fri Jul 20 10:04:33 CEST 2012


Oh, ignore me - I detected my fault.

But those sys_stat_XX() wrappers make it really hard to read the code.

- Dietmar

> -----Original Message-----
> From: sheepdog-users-bounces at lists.wpkg.org [mailto:sheepdog-users-
> bounces at lists.wpkg.org] On Behalf Of Dietmar Maurer
> Sent: Freitag, 20. Juli 2012 09:55
> To: Liu Yuan
> Cc: sheepdog-users at lists.wpkg.org
> Subject: Re: [sheepdog-users] dead code?
> 
> > > 	if (msg->cluster_status == SD_STATUS_OK ||
> > > 	    msg->cluster_status == SD_STATUS_HALT) {
> > > 		if (msg->inc_epoch) {
> > > 			uatomic_inc(&sys->epoch);
> > > 			log_current_epoch();
> > > 		}
> > > 		/* Fresh node */
> > > 		if (!sys_stat_ok() && !sys_stat_halt()) {
> > >
> > > Seems this is never triggered, because above condition make sure the
> > > one of those flags is always set?
> > >
> > > - Dietmar
> > >
> > >
> >
> > Why? cluster_status can be WAIT_FOR_JOIN OR WAIT_FOR_FORMAT.
> 
> no, because you only reach that statement if (msg->cluster_status ==
> SD_STATUS_OK || msg->cluster_status == SD_STATUS_HALT)
> 
> - Dietmar
> --
> sheepdog-users mailing lists
> sheepdog-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog-users





More information about the sheepdog-users mailing list