[sheepdog] [PATCH v2] sheep: remove sha1_from_buffer()

Liu Yuan namei.unix at gmail.com
Wed Dec 18 04:22:09 CET 2013


On Tue, Dec 17, 2013 at 11:55:16PM +0900, Hitoshi Mitake wrote:
> At Tue, 17 Dec 2013 21:36:17 +0800,
> Liu Yuan wrote:
> > 
> > This function is buggy yet tricky to debug. For now we can't pass following
> > script:
> > 
> > for i in `seq 0 2`; do
> > 	sheep/sheep -D -n -z $i -p $((7000+$i)) -c local store/$i
> > done
> > sleep 1
> > dog/dog cluster format -c 3
> > qemu-img convert linux-0.2.img sheepdog:test
> > dog/dog vdi snapshot test -s snap
> > dog/dog cluster snapshot save snap1 snapshot
> > md5sum /tmp/store/0/obj/{007c2b2500000000,007c2b2500000001,007c2b2500000002,007c2b2500000003,007c2b2500000004}
> > dog/dog cluster snapshot load snap1 snapshot
> > md5sum /tmp/store/0/obj/{007c2b2500000000,007c2b2500000001,007c2b2500000002,007c2b2500000003,007c2b2500000004}
> > dog/dog vdi read test | md5sum
> > md5sum linux-0.2.img
> > 
> > -----------------------------------------
> > 
> > Instead of debugging of it, this patch tries to remove it since the speedup
> > from sha1_from_buffer is very limited because we don't have many zero filled
> > objects.
> > 
> > Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> > ---
> >  dog/farm/sha1_file.c |    4 ++--
> >  include/sha1.h       |    2 +-
> >  lib/sha1.c           |   24 ++----------------------
> >  sheep/plain_store.c  |    2 +-
> >  4 files changed, 6 insertions(+), 26 deletions(-)
> 
> Looks good to me.
> Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Applied

Yuan



More information about the sheepdog mailing list