X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=subfile.cc;h=4f8d0fe656e9c27d13dfb9cc6dce1ff06204e454;hp=4e1300529cab2f452ad7a538c8f5429ed8a25d0d;hb=f38dd9bcb0caffd3fc9126b05788c936690e8288;hpb=d3f9ee42a4023631059f16cc2a8b96b9540750b2 diff --git a/subfile.cc b/subfile.cc index 4e13005..4f8d0fe 100644 --- a/subfile.cc +++ b/subfile.cc @@ -23,6 +23,7 @@ * referenced from the new metadata log. */ #include +#include #include #include @@ -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,8 +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); - if (analyzed_len >= 16384) - 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;