X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=subfile.cc;h=acde97ca69fa93ae60de905d3c0f54e74238b130;hb=dd3fe2c70bef48563e0f67b7cb259f00bb42f45c;hp=4e1300529cab2f452ad7a538c8f5429ed8a25d0d;hpb=d3f9ee42a4023631059f16cc2a8b96b9540750b2;p=cumulus.git diff --git a/subfile.cc b/subfile.cc index 4e13005..acde97c 100644 --- a/subfile.cc +++ b/subfile.cc @@ -1,7 +1,6 @@ -/* Cumulus: Smart Filesystem Backup to Dumb Servers - * - * Copyright (C) 2008 The Regents of the University of California - * Written by Michael Vrable +/* Cumulus: Efficient Filesystem Backup to the Cloud + * Copyright (C) 2008 The Cumulus Developers + * See the AUTHORS file for a list of contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,12 +22,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 +194,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 +270,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;