[sheepdog] [PATCH 4/9] sheep: refactor get_cluster_status

Christoph Hellwig hch at infradead.org
Wed Jun 13 13:28:24 CEST 2012


On Wed, Jun 13, 2012 at 03:12:49PM +0800, Liu Yuan wrote:
> On 06/12/2012 11:09 PM, Christoph Hellwig wrote:
> > +static int get_cluster_status(struct sd_node *joined, struct sd_node *entries,
> > +		int nr_entries, uint64_t ctime, uint32_t epoch,
> > +		uint32_t *status, uint8_t *inc_epoch)
> > +{
> > +	*status = sys->status;
> > +	if (inc_epoch)
> > +		*inc_epoch = 0;
> 
> We don't need this defensive check for itnernal API. Same for
> cluster_running_check().

One caller currently passes a NULL argument.  I think the check is a
little less bad than passing a dummy argument in that case.




More information about the sheepdog mailing list