Minor fix to segment cleaning.
[cumulus.git] / scandir.cc
index f653f43..7a7ba46 100644 (file)
@@ -189,7 +189,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path,
                 ref = ObjectReference(ObjectReference::REF_ZERO);
                 ref.set_range(0, bytes);
             } else {
-                ObjectReference ref = db->FindObject(block_csum, bytes);
+                ref = db->FindObject(block_csum, bytes);
             }
 
             // Store a copy of the object if one does not yet exist
@@ -228,6 +228,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path,
                 o->write(tss);
                 ref = o->get_ref();
                 db->StoreObject(ref, block_csum, bytes, block_age);
+                ref.set_range(0, bytes);
                 delete o;
             }
 
@@ -564,7 +565,8 @@ void usage(const char *program)
         "                       program though which to filter descriptor\n"
         "  --scheme=NAME        optional name for this snapshot\n"
         "  --intent=FLOAT       intended backup type: 1=daily, 7=weekly, ...\n"
-        "                           (defaults to \"1\")\n",
+        "                           (defaults to \"1\")\n"
+        "  --full-metadata      do not re-use metadata from previous backups\n",
         lbs_version, program
     );
 }
@@ -586,6 +588,7 @@ int main(int argc, char *argv[])
             {"scheme", 1, 0, 0},            // 5
             {"signature-filter", 1, 0, 0},  // 6
             {"intent", 1, 0, 0},            // 7
+            {"full-metadata", 0, 0, 0},     // 8
             {NULL, 0, 0, 0},
         };
 
@@ -626,6 +629,9 @@ int main(int argc, char *argv[])
                 if (snapshot_intent <= 0)
                     snapshot_intent = 1;
                 break;
+            case 8:     // --full-metadata
+                flag_full_metadata = true;
+                break;
             default:
                 fprintf(stderr, "Unhandled long option!\n");
                 return 1;