You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/06/15 16:22:33 UTC
[trafficserver] 03/23: Step 3: Remove revertToVersion() and
revertToVersion_ml()
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit d367d3674e81c7ab4798243a96a846c7fa0e59da
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Fri May 24 14:42:10 2019 -0600
Step 3: Remove revertToVersion() and revertToVersion_ml()
---
mgmt/Rollback.cc | 41 -----------------------------------------
mgmt/Rollback.h | 5 -----
2 files changed, 46 deletions(-)
diff --git a/mgmt/Rollback.cc b/mgmt/Rollback.cc
index 0350f87..1da6817 100644
--- a/mgmt/Rollback.cc
+++ b/mgmt/Rollback.cc
@@ -453,47 +453,6 @@ GET_CLEANUP:
return returnCode;
}
-RollBackCodes
-Rollback::revertToVersion(version_t version)
-{
- RollBackCodes r;
-
- ink_mutex_acquire(&fileAccessLock);
- r = this->revertToVersion_ml(version);
- ink_mutex_release(&fileAccessLock);
-
- return r;
-}
-
-// Rollback::revertToVersion_ml(version_t version)
-//
-// assumes callee is holding this->fileAccessLock
-//
-// moves the current version to fileName_currentVersion
-// copies fileName_revertToVersion fileName
-// increases this->currentVersion, this->numVersion
-//
-RollBackCodes
-Rollback::revertToVersion_ml(version_t version)
-{
- RollBackCodes returnCode;
- TextBuffer *revertTo;
-
- returnCode = this->getVersion_ml(version, &revertTo);
- if (returnCode != OK_ROLLBACK) {
- mgmt_log("[Rollback::revertToVersion] Unable to open version %d of %s\n", version, fileName);
- return returnCode;
- }
-
- returnCode = forceUpdate_ml(revertTo);
- if (returnCode != OK_ROLLBACK) {
- mgmt_log("[Rollback::revertToVersion] Unable to revert to version %d of %s\n", version, fileName);
- }
-
- delete revertTo;
- return OK_ROLLBACK;
-}
-
// version_t Rollback::extractVersionInfo(ExpandingArray* listNames,
// const char* testFileName)
//
diff --git a/mgmt/Rollback.h b/mgmt/Rollback.h
index 4327e00..64b24a8 100644
--- a/mgmt/Rollback.h
+++ b/mgmt/Rollback.h
@@ -67,9 +67,6 @@ struct versionInfo {
// removeVersion(version_t ) - removes the specified version from the
// configuration directory
//
-// revertToVersion(version_t) - rolls the active version to a new file
-// The specified version of the file is copied to the active version
-//
// getVersion(version_t version, TextBuffer** buffer, version_t) -
// creates a new TextBuffer that contains the contents of the specified
// version. CALLEE MUST DELETE the buffer
@@ -143,7 +140,6 @@ public:
ink_mutex_release(&fileAccessLock);
};
RollBackCodes removeVersion_ml(version_t version);
- RollBackCodes revertToVersion_ml(version_t version);
RollBackCodes getVersion_ml(version_t version, TextBuffer **buffer);
RollBackCodes updateVersion_ml(TextBuffer *buf, version_t basedOn, version_t newVersion = -1, bool notifyChange = true,
bool incVersion = true);
@@ -154,7 +150,6 @@ public:
// Automatically take out lock
bool checkForUserUpdate(RollBackCheckType);
RollBackCodes removeVersion(version_t version);
- RollBackCodes revertToVersion(version_t version);
RollBackCodes getVersion(version_t version, TextBuffer **buffer);
RollBackCodes updateVersion(TextBuffer *buf, version_t basedOn, version_t newVersion = -1, bool notifyChange = true,
bool incVersion = true);