Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 183c288

Browse files
nathan-bossartCommitfest Bot
authored and
Commitfest Bot
committed
Partially revert commit a0a4601.
Thanks to commit XXXXXXXXXX, which simplified some code in _tocEntryRestorePass(), we can remove the now-unused ArchiveHandle parameter from _tocEntryRestorePass() and move_to_ready_heap(). Reviewed-by: Jeff Davis <pgsql@j-davis.com> Discussion: https://postgr.es/m/Z-3x2AnPCP331JA3%40nathan
1 parent a1bd2a8 commit 183c288

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void processEncodingEntry(ArchiveHandle *AH, TocEntry *te);
7272
static void processStdStringsEntry(ArchiveHandle *AH, TocEntry *te);
7373
static void processSearchPathEntry(ArchiveHandle *AH, TocEntry *te);
7474
static int _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH);
75-
static RestorePass _tocEntryRestorePass(ArchiveHandle *AH, TocEntry *te);
75+
static RestorePass _tocEntryRestorePass(TocEntry *te);
7676
static bool _tocEntryIsACL(TocEntry *te);
7777
static void _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
7878
static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
@@ -102,8 +102,7 @@ static void pending_list_append(TocEntry *l, TocEntry *te);
102102
static void pending_list_remove(TocEntry *te);
103103
static int TocEntrySizeCompareQsort(const void *p1, const void *p2);
104104
static int TocEntrySizeCompareBinaryheap(void *p1, void *p2, void *arg);
105-
static void move_to_ready_heap(ArchiveHandle *AH,
106-
TocEntry *pending_list,
105+
static void move_to_ready_heap(TocEntry *pending_list,
107106
binaryheap *ready_heap,
108107
RestorePass pass);
109108
static TocEntry *pop_next_work_item(binaryheap *ready_heap,
@@ -749,7 +748,7 @@ RestoreArchive(Archive *AHX)
749748
if ((te->reqs & (REQ_SCHEMA | REQ_DATA | REQ_STATS)) == 0)
750749
continue; /* ignore if not to be dumped at all */
751750

752-
switch (_tocEntryRestorePass(AH, te))
751+
switch (_tocEntryRestorePass(te))
753752
{
754753
case RESTORE_PASS_MAIN:
755754
(void) restore_toc_entry(AH, te, false);
@@ -768,7 +767,7 @@ RestoreArchive(Archive *AHX)
768767
for (te = AH->toc->next; te != AH->toc; te = te->next)
769768
{
770769
if ((te->reqs & (REQ_SCHEMA | REQ_DATA | REQ_STATS)) != 0 &&
771-
_tocEntryRestorePass(AH, te) == RESTORE_PASS_ACL)
770+
_tocEntryRestorePass(te) == RESTORE_PASS_ACL)
772771
(void) restore_toc_entry(AH, te, false);
773772
}
774773
}
@@ -778,7 +777,7 @@ RestoreArchive(Archive *AHX)
778777
for (te = AH->toc->next; te != AH->toc; te = te->next)
779778
{
780779
if ((te->reqs & (REQ_SCHEMA | REQ_DATA | REQ_STATS)) != 0 &&
781-
_tocEntryRestorePass(AH, te) == RESTORE_PASS_POST_ACL)
780+
_tocEntryRestorePass(te) == RESTORE_PASS_POST_ACL)
782781
(void) restore_toc_entry(AH, te, false);
783782
}
784783
}
@@ -3261,7 +3260,7 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
32613260
* See notes with the RestorePass typedef in pg_backup_archiver.h.
32623261
*/
32633262
static RestorePass
3264-
_tocEntryRestorePass(ArchiveHandle *AH, TocEntry *te)
3263+
_tocEntryRestorePass(TocEntry *te)
32653264
{
32663265
/* "ACL LANGUAGE" was a crock emitted only in PG 7.4 */
32673266
if (strcmp(te->desc, "ACL") == 0 ||
@@ -4344,7 +4343,7 @@ restore_toc_entries_prefork(ArchiveHandle *AH, TocEntry *pending_list)
43444343
* not set skipped_some in this case, since by assumption no main-pass
43454344
* items could depend on these.
43464345
*/
4347-
if (_tocEntryRestorePass(AH, next_work_item) != RESTORE_PASS_MAIN)
4346+
if (_tocEntryRestorePass(next_work_item) != RESTORE_PASS_MAIN)
43484347
do_now = false;
43494348

43504349
if (do_now)
@@ -4426,7 +4425,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
44264425
* process in the current restore pass.
44274426
*/
44284427
AH->restorePass = RESTORE_PASS_MAIN;
4429-
move_to_ready_heap(AH, pending_list, ready_heap, AH->restorePass);
4428+
move_to_ready_heap(pending_list, ready_heap, AH->restorePass);
44304429

44314430
/*
44324431
* main parent loop
@@ -4475,7 +4474,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
44754474
/* Advance to next restore pass */
44764475
AH->restorePass++;
44774476
/* That probably allows some stuff to be made ready */
4478-
move_to_ready_heap(AH, pending_list, ready_heap, AH->restorePass);
4477+
move_to_ready_heap(pending_list, ready_heap, AH->restorePass);
44794478
/* Loop around to see if anything's now ready */
44804479
continue;
44814480
}
@@ -4646,8 +4645,7 @@ TocEntrySizeCompareBinaryheap(void *p1, void *p2, void *arg)
46464645
* which applies the same logic one-at-a-time.)
46474646
*/
46484647
static void
4649-
move_to_ready_heap(ArchiveHandle *AH,
4650-
TocEntry *pending_list,
4648+
move_to_ready_heap(TocEntry *pending_list,
46514649
binaryheap *ready_heap,
46524650
RestorePass pass)
46534651
{
@@ -4660,7 +4658,7 @@ move_to_ready_heap(ArchiveHandle *AH,
46604658
next_te = te->pending_next;
46614659

46624660
if (te->depCount == 0 &&
4663-
_tocEntryRestorePass(AH, te) == pass)
4661+
_tocEntryRestorePass(te) == pass)
46644662
{
46654663
/* Remove it from pending_list ... */
46664664
pending_list_remove(te);
@@ -5054,7 +5052,7 @@ reduce_dependencies(ArchiveHandle *AH, TocEntry *te,
50545052
* memberships changed.
50555053
*/
50565054
if (otherte->depCount == 0 &&
5057-
_tocEntryRestorePass(AH, otherte) == AH->restorePass &&
5055+
_tocEntryRestorePass(otherte) == AH->restorePass &&
50585056
otherte->pending_prev != NULL &&
50595057
ready_heap != NULL)
50605058
{

0 commit comments

Comments
 (0)