Skip to content

Commit ff3a7f0

Browse files
Remove unused function parameters in pg_backup_archiver.c.
Thanks to commit 9c02e3a, which modified some of the changes from commit a0a4601, 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 9c02e3a commit ff3a7f0

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 ||
@@ -4342,7 +4341,7 @@ restore_toc_entries_prefork(ArchiveHandle *AH, TocEntry *pending_list)
43424341
* not set skipped_some in this case, since by assumption no main-pass
43434342
* items could depend on these.
43444343
*/
4345-
if (_tocEntryRestorePass(AH, next_work_item) != RESTORE_PASS_MAIN)
4344+
if (_tocEntryRestorePass(next_work_item) != RESTORE_PASS_MAIN)
43464345
do_now = false;
43474346

43484347
if (do_now)
@@ -4424,7 +4423,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
44244423
* process in the current restore pass.
44254424
*/
44264425
AH->restorePass = RESTORE_PASS_MAIN;
4427-
move_to_ready_heap(AH, pending_list, ready_heap, AH->restorePass);
4426+
move_to_ready_heap(pending_list, ready_heap, AH->restorePass);
44284427

44294428
/*
44304429
* main parent loop
@@ -4473,7 +4472,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
44734472
/* Advance to next restore pass */
44744473
AH->restorePass++;
44754474
/* That probably allows some stuff to be made ready */
4476-
move_to_ready_heap(AH, pending_list, ready_heap, AH->restorePass);
4475+
move_to_ready_heap(pending_list, ready_heap, AH->restorePass);
44774476
/* Loop around to see if anything's now ready */
44784477
continue;
44794478
}
@@ -4644,8 +4643,7 @@ TocEntrySizeCompareBinaryheap(void *p1, void *p2, void *arg)
46444643
* which applies the same logic one-at-a-time.)
46454644
*/
46464645
static void
4647-
move_to_ready_heap(ArchiveHandle *AH,
4648-
TocEntry *pending_list,
4646+
move_to_ready_heap(TocEntry *pending_list,
46494647
binaryheap *ready_heap,
46504648
RestorePass pass)
46514649
{
@@ -4658,7 +4656,7 @@ move_to_ready_heap(ArchiveHandle *AH,
46584656
next_te = te->pending_next;
46594657

46604658
if (te->depCount == 0 &&
4661-
_tocEntryRestorePass(AH, te) == pass)
4659+
_tocEntryRestorePass(te) == pass)
46624660
{
46634661
/* Remove it from pending_list ... */
46644662
pending_list_remove(te);
@@ -5052,7 +5050,7 @@ reduce_dependencies(ArchiveHandle *AH, TocEntry *te,
50525050
* memberships changed.
50535051
*/
50545052
if (otherte->depCount == 0 &&
5055-
_tocEntryRestorePass(AH, otherte) == AH->restorePass &&
5053+
_tocEntryRestorePass(otherte) == AH->restorePass &&
50565054
otherte->pending_prev != NULL &&
50575055
ready_heap != NULL)
50585056
{

0 commit comments

Comments
 (0)