Skip to content

Commit 2ae2908

Browse files
committed
Code cleanup. Remove unused functions
1 parent fc1bef8 commit 2ae2908

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

src/catalog.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,33 +2741,6 @@ pgBackupGetPath2(const pgBackup *backup, char *path, size_t len,
27412741
base36enc(backup->start_time), subdir1, subdir2);
27422742
}
27432743

2744-
/*
2745-
* independent from global variable backup_instance_path
2746-
* Still depends from backup_path
2747-
*/
2748-
void
2749-
pgBackupGetPathInInstance(const char *instance_name,
2750-
const pgBackup *backup, char *path, size_t len,
2751-
const char *subdir1, const char *subdir2)
2752-
{
2753-
char backup_instance_path[MAXPGPATH];
2754-
2755-
sprintf(backup_instance_path, "%s/%s/%s",
2756-
backup_path, BACKUPS_DIR, instance_name);
2757-
2758-
/* If "subdir1" is NULL do not check "subdir2" */
2759-
if (!subdir1)
2760-
snprintf(path, len, "%s/%s", backup_instance_path,
2761-
base36enc(backup->start_time));
2762-
else if (!subdir2)
2763-
snprintf(path, len, "%s/%s/%s", backup_instance_path,
2764-
base36enc(backup->start_time), subdir1);
2765-
/* "subdir1" and "subdir2" is not NULL */
2766-
else
2767-
snprintf(path, len, "%s/%s/%s/%s", backup_instance_path,
2768-
base36enc(backup->start_time), subdir1, subdir2);
2769-
}
2770-
27712744
/*
27722745
* Check if multiple backups consider target backup to be their direct parent
27732746
*/
@@ -2917,26 +2890,6 @@ is_parent(time_t parent_backup_time, pgBackup *child_backup, bool inclusive)
29172890
return false;
29182891
}
29192892

2920-
/*
2921-
* Return backup index number.
2922-
* Note: this index number holds true until new sorting of backup list
2923-
*/
2924-
int
2925-
get_backup_index_number(parray *backup_list, pgBackup *backup)
2926-
{
2927-
int i;
2928-
2929-
for (i = 0; i < parray_num(backup_list); i++)
2930-
{
2931-
pgBackup *tmp_backup = (pgBackup *) parray_get(backup_list, i);
2932-
2933-
if (tmp_backup->start_time == backup->start_time)
2934-
return i;
2935-
}
2936-
elog(WARNING, "Failed to find backup %s", base36enc(backup->start_time));
2937-
return -1;
2938-
}
2939-
29402893
/* On backup_list lookup children of target_backup and append them to append_list */
29412894
void
29422895
append_children(parray *backup_list, pgBackup *target_backup, parray *append_list)

src/pg_probackup.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,6 @@ extern void pgBackupGetPath(const pgBackup *backup, char *path, size_t len,
948948
const char *subdir);
949949
extern void pgBackupGetPath2(const pgBackup *backup, char *path, size_t len,
950950
const char *subdir1, const char *subdir2);
951-
extern void pgBackupGetPathInInstance(const char *instance_name,
952-
const pgBackup *backup, char *path, size_t len,
953-
const char *subdir1, const char *subdir2);
954951
extern void pgBackupCreateDir(pgBackup *backup, const char *backup_instance_path);
955952
extern void pgNodeInit(PGNodeInfo *node);
956953
extern void pgBackupInit(pgBackup *backup);
@@ -968,7 +965,6 @@ extern int scan_parent_chain(pgBackup *current_backup, pgBackup **result_backup)
968965

969966
extern bool is_parent(time_t parent_backup_time, pgBackup *child_backup, bool inclusive);
970967
extern bool is_prolific(parray *backup_list, pgBackup *target_backup);
971-
extern int get_backup_index_number(parray *backup_list, pgBackup *backup);
972968
extern void append_children(parray *backup_list, pgBackup *target_backup, parray *append_list);
973969
extern bool launch_agent(void);
974970
extern void launch_ssh(char* argv[]);

0 commit comments

Comments
 (0)