summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreCheck2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backupstore/BackupStoreCheck2.cpp')
-rw-r--r--lib/backupstore/BackupStoreCheck2.cpp104
1 files changed, 0 insertions, 104 deletions
diff --git a/lib/backupstore/BackupStoreCheck2.cpp b/lib/backupstore/BackupStoreCheck2.cpp
index 341ac524..90e21e7f 100644
--- a/lib/backupstore/BackupStoreCheck2.cpp
+++ b/lib/backupstore/BackupStoreCheck2.cpp
@@ -12,19 +12,6 @@
#include <stdio.h>
#include <string.h>
-<<<<<<< HEAD
-#include "BackupStoreCheck.h"
-#include "StoreStructure.h"
-#include "RaidFileRead.h"
-#include "RaidFileWrite.h"
-#include "autogen_BackupStoreException.h"
-#include "BackupStoreObjectMagic.h"
-#include "BackupStoreFile.h"
-#include "BackupStoreFileWire.h"
-#include "BackupStoreDirectory.h"
-#include "BackupStoreConstants.h"
-#include "BackupStoreInfo.h"
-=======
#include "autogen_BackupStoreException.h"
#include "BackupStoreCheck.h"
#include "BackupStoreConstants.h"
@@ -37,7 +24,6 @@
#include "RaidFileRead.h"
#include "RaidFileWrite.h"
#include "StoreStructure.h"
->>>>>>> 0.12
#include "MemLeakFindOn.h"
@@ -152,11 +138,7 @@ void BackupStoreCheck::CheckUnattachedObjects()
if((flags & Flags_IsContained) == 0)
{
// Unattached object...
-<<<<<<< HEAD
- BOX_WARNING("Object " <<
-=======
BOX_ERROR("Object " <<
->>>>>>> 0.12
BOX_FORMAT_OBJECTID(pblock->mID[e]) <<
" is unattached.");
++mNumberErrorsFound;
@@ -176,10 +158,7 @@ void BackupStoreCheck::CheckUnattachedObjects()
int64_t diffFromObjectID = 0;
std::string filename;
StoreStructure::MakeObjectFilename(pblock->mID[e], mStoreRoot, mDiscSetNumber, filename, false /* don't attempt to make sure the dir exists */);
-<<<<<<< HEAD
-=======
->>>>>>> 0.12
// The easiest way to do this is to verify it again. Not such a bad penalty, because
// this really shouldn't be done very often.
{
@@ -405,11 +384,7 @@ void BackupStoreDirectoryFixer::InsertObject(int64_t ObjectID, bool IsDirectory,
}
// Add a new entry in an appropriate place
-<<<<<<< HEAD
- mDirectory.AddUnattactedObject(objectStoreFilename, modTime,
-=======
mDirectory.AddUnattachedObject(objectStoreFilename, modTime,
->>>>>>> 0.12
ObjectID, sizeInBlocks,
IsDirectory?(BackupStoreDirectory::Entry::Flags_Dir):(BackupStoreDirectory::Entry::Flags_File));
}
@@ -600,19 +575,6 @@ void BackupStoreCheck::FixDirsWithLostDirs()
void BackupStoreCheck::WriteNewStoreInfo()
{
// Attempt to load the existing store info file
-<<<<<<< HEAD
- std::auto_ptr<BackupStoreInfo> poldInfo;
- try
- {
- poldInfo.reset(BackupStoreInfo::Load(mAccountID, mStoreRoot, mDiscSetNumber, true /* read only */).release());
- }
- catch(...)
- {
- BOX_WARNING("Load of existing store info failed, regenerating.");
- ++mNumberErrorsFound;
- }
-
-=======
std::auto_ptr<BackupStoreInfo> pOldInfo;
try
{
@@ -630,19 +592,14 @@ void BackupStoreCheck::WriteNewStoreInfo()
"deleted files: " << mNumDeletedFiles << "), "
"directories: " << mNumDirectories);
->>>>>>> 0.12
// Minimum soft and hard limits
int64_t minSoft = ((mBlocksUsed * 11) / 10) + 1024;
int64_t minHard = ((minSoft * 11) / 10) + 1024;
// Need to do anything?
-<<<<<<< HEAD
- if(poldInfo.get() != 0 && mNumberErrorsFound == 0 && poldInfo->GetAccountID() == mAccountID)
-=======
if(pOldInfo.get() != 0 &&
mNumberErrorsFound == 0 &&
pOldInfo->GetAccountID() == mAccountID)
->>>>>>> 0.12
{
// Leave the store info as it is, no need to alter it because nothing really changed,
// and the only essential thing was that the account ID was correct, which is was.
@@ -654,23 +611,6 @@ void BackupStoreCheck::WriteNewStoreInfo()
// Work out the new limits
int64_t softLimit = minSoft;
int64_t hardLimit = minHard;
-<<<<<<< HEAD
- if(poldInfo.get() != 0 && poldInfo->GetBlocksSoftLimit() > minSoft)
- {
- softLimit = poldInfo->GetBlocksSoftLimit();
- }
- else
- {
- BOX_WARNING("Soft limit for account changed to ensure housekeeping doesn't delete files on next run.");
- }
- if(poldInfo.get() != 0 && poldInfo->GetBlocksHardLimit() > minHard)
- {
- hardLimit = poldInfo->GetBlocksHardLimit();
- }
- else
- {
- BOX_WARNING("Hard limit for account changed to ensure housekeeping doesn't delete files on next run.");
-=======
if(pOldInfo.get() != 0 && pOldInfo->GetBlocksSoftLimit() > minSoft)
{
softLimit = pOldInfo->GetBlocksSoftLimit();
@@ -688,7 +628,6 @@ void BackupStoreCheck::WriteNewStoreInfo()
{
BOX_WARNING("Hard limit for account changed to ensure "
"housekeeping doesn't delete files on next run.");
->>>>>>> 0.12
}
// Object ID
@@ -699,10 +638,6 @@ void BackupStoreCheck::WriteNewStoreInfo()
}
// Build a new store info
-<<<<<<< HEAD
- std::auto_ptr<BackupStoreInfo> info(BackupStoreInfo::CreateForRegeneration(
- mAccountID,
-=======
std::auto_ptr<MemBlockStream> extra_data;
if(pOldInfo.get())
{
@@ -715,22 +650,15 @@ void BackupStoreCheck::WriteNewStoreInfo()
std::auto_ptr<BackupStoreInfo> info(BackupStoreInfo::CreateForRegeneration(
mAccountID,
mAccountName,
->>>>>>> 0.12
mStoreRoot,
mDiscSetNumber,
lastObjID,
mBlocksUsed,
-<<<<<<< HEAD
-=======
mBlocksInCurrentFiles,
->>>>>>> 0.12
mBlocksInOldFiles,
mBlocksInDeletedFiles,
mBlocksInDirectories,
softLimit,
-<<<<<<< HEAD
- hardLimit));
-=======
hardLimit,
(pOldInfo.get() ? pOldInfo->IsAccountEnabled() : true),
*extra_data));
@@ -743,7 +671,6 @@ void BackupStoreCheck::WriteNewStoreInfo()
{
mNumberErrorsFound += info->ReportChangesTo(*pOldInfo);
}
->>>>>>> 0.12
// Save to disc?
if(mFixErrors)
@@ -770,16 +697,12 @@ bool BackupStoreDirectory::CheckAndFix()
bool changed = false;
// Check that if a file depends on a new version, that version is in this directory
-<<<<<<< HEAD
- {
-=======
bool restart;
do
{
restart = false;
->>>>>>> 0.12
std::vector<Entry*>::iterator i(mEntries.begin());
for(; i != mEntries.end(); ++i)
{
@@ -790,11 +713,7 @@ bool BackupStoreDirectory::CheckAndFix()
if(newerEn == 0)
{
// Depends on something, but it isn't there.
-<<<<<<< HEAD
- BOX_TRACE("Entry id " << FMT_i <<
-=======
BOX_WARNING("Entry id " << FMT_i <<
->>>>>>> 0.12
" removed because depends "
"on newer version " <<
FMT_OID(dependsNewer) <<
@@ -804,20 +723,12 @@ bool BackupStoreDirectory::CheckAndFix()
delete *i;
mEntries.erase(i);
-<<<<<<< HEAD
- // Start again at the beginning of the vector, the iterator is now invalid
- i = mEntries.begin();
-
- // Mark as changed
- changed = true;
-=======
// Mark as changed
changed = true;
// Start again at the beginning of the vector, the iterator is now invalid
restart = true;
break;
->>>>>>> 0.12
}
else
{
@@ -839,10 +750,7 @@ bool BackupStoreDirectory::CheckAndFix()
}
}
}
-<<<<<<< HEAD
-=======
while(restart);
->>>>>>> 0.12
// Check that if a file has a dependency marked, it exists, and remove it if it doesn't
{
@@ -967,11 +875,7 @@ bool BackupStoreDirectory::CheckAndFix()
// erase the thing from the list
Entry *pentry = (*i);
mEntries.erase(i);
-<<<<<<< HEAD
-
-=======
->>>>>>> 0.12
// And delete the entry object
delete pentry;
@@ -989,20 +893,12 @@ bool BackupStoreDirectory::CheckAndFix()
// --------------------------------------------------------------------------
//
// Function
-<<<<<<< HEAD
-// Name: BackupStoreDirectory::AddUnattactedObject(...)
-=======
// Name: BackupStoreDirectory::AddUnattachedObject(...)
->>>>>>> 0.12
// Purpose: Adds an object which is currently unattached. Assume that CheckAndFix() will be called afterwards.
// Created: 22/4/04
//
// --------------------------------------------------------------------------
-<<<<<<< HEAD
-void BackupStoreDirectory::AddUnattactedObject(const BackupStoreFilename &rName,
-=======
void BackupStoreDirectory::AddUnattachedObject(const BackupStoreFilename &rName,
->>>>>>> 0.12
box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags)
{
Entry *pnew = new Entry(rName, ModificationTime, ObjectID, SizeInBlocks, Flags,