]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_restore.c
Keep the same keywords as in previous version
[bacula/bacula] / bacula / src / dird / ua_restore.c
index 8377c22a4311121c9f9edb8e11c555da801a1102..a02ff7f0e7e8abaa835ed8deda81a2be2e7fc483 100644 (file)
@@ -1067,14 +1067,20 @@ static bool ask_for_fileregex(UAContext *ua, RESTORE_CTX *rx)
 }
 
 /* Walk on the delta_list of a TREE_NODE item and insert all parts
- * TODO: Optimize for bootstrap creation 
+ * TODO: Optimize for bootstrap creation, remove recursion
+ * 6 -> 5 -> 4 -> 3 -> 2 -> 1 -> 0
+ * should insert as
+ * 0, 1, 2, 3, 4, 5, 6
  */
 static void add_delta_list_findex(RESTORE_CTX *rx, struct delta_list *lst)
 {
-   while (lst != NULL) {
-      add_findex(rx->bsr, lst->JobId, lst->FileIndex);
-      lst = lst->next;
+   if (lst == NULL) {
+      return;
+   }
+   if (lst->next) {
+      add_delta_list_findex(rx, lst->next);
    }
+   add_findex(rx->bsr, lst->JobId, lst->FileIndex);
 }
 
 static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
@@ -1117,9 +1123,10 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
 
 #define new_get_file_list
 #ifdef new_get_file_list
-   if (!db_get_file_list_with_delta(ua->jcr, ua->db, 
-                                    rx->JobIds, false /* do not use md5 */, 
-                                    insert_tree_handler, (void *)&tree))
+   if (!db_get_file_list(ua->jcr, ua->db, 
+                         rx->JobIds, false /* do not use md5 */, 
+                         true /* get delta */,
+                         insert_tree_handler, (void *)&tree))
    {
       ua->error_msg("%s", db_strerror(ua->db));
    }