Commit a1832ffa authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:2892] Delete obsolete function.

git-svn-id: file:///svn/toku/tokudb@26349 c7de825b-a66e-492c-adef-691d508d4ae1
parent b334a552
...@@ -1367,7 +1367,9 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS s) { ...@@ -1367,7 +1367,9 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS s) {
} }
} }
//Used for upgrade // Used for upgrade:
// if any valid log files exist in log_dir, then
// set *found_any_logs to TRUE and set *version_found to version number of latest log
int int
toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint32_t *version_found) { toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint32_t *version_found) {
BOOL found = FALSE; BOOL found = FALSE;
...@@ -1406,43 +1408,3 @@ toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint ...@@ -1406,43 +1408,3 @@ toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint
return r; return r;
} }
//Used for upgrade
int
toku_delete_all_logs_of_version(const char *log_dir, uint32_t version_to_delete) {
int r = 0;
struct dirent *de;
DIR *d=opendir(log_dir);
if (d==NULL) {
r = errno;
}
else {
// Examine every file in the directory and if it is a log of the given version, delete it
while ((de=readdir(d))) {
uint32_t this_log_version;
uint64_t this_log_number;
BOOL is_log = is_a_logfile_any_version(de->d_name, &this_log_number, &this_log_version);
if (is_log && this_log_version == version_to_delete) {
char log_full_name[strlen(log_dir) + strlen(de->d_name) + 2]; //'\0' and '/'
{ //Generate full fname
int l = snprintf(log_full_name, sizeof(log_full_name),
"%s/%s", log_dir, de->d_name);
assert(l+1 == (ssize_t)(sizeof(log_full_name)));
}
r = unlink(log_full_name);
if (r!=0) {
r = errno;
assert(r);
break;
}
}
}
}
{
int r2 = closedir(d);
if (r==0) r = r2;
}
return r;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment