From: Eric Bollengier Date: Sun, 21 Nov 2010 15:04:35 +0000 (+0100) Subject: Insert Delta in bootstrap by JobTDate X-Git-Tag: Release-7.0.0~1360 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=04d2e746550ef971dcbd3253026b1c97979f3bbe;p=bacula%2Fbacula Insert Delta in bootstrap by JobTDate --- diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 73df8ca22a..a02ff7f0e7 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -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)