[sheepdog] [PATCH] sheep: make epoch_log_read() clean

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Mar 19 04:41:06 CET 2013


At Tue, 19 Mar 2013 11:35:14 +0900,
Hitoshi Mitake wrote:
> 
> At Tue, 19 Mar 2013 10:52:35 +0900,
> MORITA Kazutaka wrote:
> > 
> > At Tue, 19 Mar 2013 10:04:46 +0900,
> > Hitoshi Mitake wrote:
> > > 
> > > At Mon, 18 Mar 2013 16:55:00 +0900,
> > > MORITA Kazutaka wrote:
> > > > 
> > > > > diff --git a/include/internal_proto.h b/include/internal_proto.h
> > > > > index f237a86..6b3866d 100644
> > > > > --- a/include/internal_proto.h
> > > > > +++ b/include/internal_proto.h
> > > > > @@ -191,7 +191,7 @@ struct sd_node {
> > > > >  
> > > > >  struct epoch_log {
> > > > >  	uint64_t ctime;
> > > > > -	uint64_t time;
> > > > > +	time_t time;
> > > > 
> > > > Can this guarantee that struct epoch_log is aligned to 64 bit
> > > > boundaries?
> > > 
> > > It cannot guarantee the alignment. I'll fix in the next version.
> > > BTW, where does the constraint of alignment come from?
> > 
> > On-disk format and network protocol must be 64 bit aligned.  Otherwise
> > we cannot share them between different architectures.  Try
> > sizeof(struct epoch_log) on 32 bit and 64 bit machines after applying
> > the above change.
> 
> Thanks, I understand.
> 
> But current sheep seems not to be aware about endianness. Is
> supporting architectures which employ big endian a future work?

Yes, it's a future work, but there is no actual plan to do it.  Please
take into account only i386 and x86_64 at least for now.

Thanks,

Kazutaka



More information about the sheepdog mailing list