X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;ds=sidebyside;f=subfile.cc;h=eee3bdf0ff05bb8ad05282323ea7c1a1e8d03234;hb=76ce8210bee6f9c2dbefab56873a9b2847d92a13;hp=f365c4b4a383e8a2dee79c940bf62b8b5db57c16;hpb=26f68e9df784020f16bbc295342123b0eca7de9b;p=cumulus.git diff --git a/subfile.cc b/subfile.cc index f365c4b..eee3bdf 100644 --- a/subfile.cc +++ b/subfile.cc @@ -23,12 +23,13 @@ * referenced from the new metadata log. */ #include +#include #include #include #include "subfile.h" -#include "chunk.h" -#include "sha1.h" +#include "third_party/chunk.h" +#include "third_party/sha1.h" using std::list; using std::map; @@ -194,6 +195,12 @@ void Subfile::store_block_signatures(ObjectReference ref, block_summary summary) free(packed); } +void Subfile::store_analyzed_signatures(ObjectReference ref) +{ + if (analyzed_len >= 16384) + store_block_signatures(ref, new_block_summary); +} + /* Compute an incremental representation of the most recent block analyzed. */ enum subfile_item_type { SUBFILE_COPY, SUBFILE_NEW }; @@ -264,7 +271,8 @@ list Subfile::create_incremental(TarSegmentStore *tss, o->write(tss); ObjectReference ref = o->get_ref(); db->StoreObject(ref, block_csum, analyzed_len, block_age); - store_block_signatures(ref, new_block_summary); + store_analyzed_signatures(ref); + ref.set_range(0, analyzed_len, true); refs.push_back(ref); delete o; return refs;