Skip to content

Commit

Permalink
Remove unused code, to reduce diffs to s3_support_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Jan 19, 2018
1 parent bcb826e commit b1cc966
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 39 deletions.
9 changes: 1 addition & 8 deletions lib/backupstore/BackupAccountControl.h
Expand Up @@ -55,12 +55,6 @@ class BackupAccountControl
virtual BackupFileSystem* GetCurrentFileSystem() { return mapFileSystem.get(); }
int CreateAccount(int32_t AccountID, int32_t SoftLimit, int32_t HardLimit,
const std::string& AccountName);
// Close any open BackupFileSystem. Invalidates any references to it. Careless use of this
// interface might introduce subtle bugs.
void CloseFileSystem()
{
mapFileSystem.reset();
}
};


Expand All @@ -87,8 +81,7 @@ class BackupStoreAccountControl : public BackupAccountControl
int DeleteAccount(bool AskForConfirmation);
int CheckAccount(bool FixErrors, bool Quiet,
bool ReturnNumErrorsFound = false);
int CreateAccount(int32_t DiscNumber, int32_t SoftLimit,
int32_t HardLimit);
int CreateAccount(int32_t DiscNumber, int32_t SoftLimit, int32_t HardLimit);
int HousekeepAccountNow();
virtual BackupFileSystem& GetFileSystem()
{
Expand Down
2 changes: 0 additions & 2 deletions lib/backupstore/BackupFileSystem.cpp
Expand Up @@ -22,8 +22,6 @@
# include <process.h> // for getpid() on Windows
#endif

#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>

#include <sstream>
Expand Down
1 change: 0 additions & 1 deletion lib/backupstore/BackupStoreAccounts.cpp
Expand Up @@ -15,7 +15,6 @@
#include <cstring>
#include <iostream>

#include "BackupFileSystem.h"
#include "BackupStoreAccounts.h"
#include "BackupStoreAccountDatabase.h"
#include "BackupStoreConstants.h"
Expand Down
2 changes: 0 additions & 2 deletions lib/backupstore/BackupStoreAccounts.h
Expand Up @@ -14,8 +14,6 @@

#include "BackupStoreAccountDatabase.h"

class NamedLock;

// --------------------------------------------------------------------------
//
// Class
Expand Down
5 changes: 1 addition & 4 deletions lib/backupstore/BackupStoreCheck.cpp
Expand Up @@ -16,11 +16,8 @@
# include <unistd.h>
#endif

#ifdef WIN32
# include <io.h> // for _mktemp_s
#endif

#include "autogen_BackupStoreException.h"
#include "BackupFileSystem.h"
#include "BackupStoreAccountDatabase.h"
#include "BackupStoreCheck.h"
#include "BackupStoreConstants.h"
Expand Down
7 changes: 1 addition & 6 deletions lib/backupstore/BackupStoreCheck.h
Expand Up @@ -15,13 +15,11 @@
#include <vector>
#include <set>

#include "BackupFileSystem.h"
#include "BackupStoreDirectory.h"
#include "NamedLock.h"
#include "Utils.h" // for object_exists_t

class IOStream;
class BackupStoreFilename;
class BackupFileSystem;
class BackupStoreRefCountDatabase;

/*
Expand Down Expand Up @@ -180,9 +178,6 @@ class BackupStoreCheck

int64_t mNumberErrorsFound;

// Lock for the store account
NamedLock mAccountLock;

// Storage for ID data
typedef std::map<BackupStoreCheck_ID_t, IDBlock*> Info_t;
Info_t mInfo;
Expand Down
1 change: 1 addition & 0 deletions lib/backupstore/BackupStoreCheck2.cpp
Expand Up @@ -13,6 +13,7 @@
#include <string.h>

#include "autogen_BackupStoreException.h"
#include "BackupFileSystem.h"
#include "BackupStoreCheck.h"
#include "BackupStoreConstants.h"
#include "BackupStoreDirectory.h"
Expand Down
4 changes: 0 additions & 4 deletions lib/backupstore/BackupStoreInfo.h
Expand Up @@ -124,10 +124,6 @@ class BackupStoreInfo
void AdjustNumOldFiles(int64_t increase);
void AdjustNumDeletedFiles(int64_t increase);
void AdjustNumDirectories(int64_t increase);
void SetLastObjectIDUsed(int64_t LastObjectIDUsed)
{
mLastObjectIDUsed = LastObjectIDUsed;
}

// Object IDs
int64_t AllocateObjectID();
Expand Down
2 changes: 0 additions & 2 deletions lib/common/MemLeakFinder.h
Expand Up @@ -51,8 +51,6 @@ void memleakfinder_traceblocksinsection();

void memleakfinder_notaleak(void *ptr);

void memleakfinder_delete(void *ptr);

void *operator new (size_t size, const char *file, int line);
void *operator new[](size_t size, const char *file, int line);
// "If the object is being created as part of a new expression, and an exception is thrown, the
Expand Down
5 changes: 3 additions & 2 deletions test/backupstore/testbackupstore.cpp
Expand Up @@ -40,6 +40,7 @@
#include "FileStream.h"
#include "HousekeepStoreAccount.h"
#include "MemBlockStream.h"
#include "NamedLock.h" // for BOX_LOCK_TYPE_F_SETLK
#include "RaidFileController.h"
#include "RaidFileException.h"
#include "RaidFileRead.h"
Expand Down Expand Up @@ -2474,8 +2475,8 @@ bool test_cannot_open_multiple_writable_connections()
// Set the client store marker
protocolWritable.QuerySetClientStoreMarker(0x8732523ab23aLL);

// This works on platforms that have non-reentrant file locks: Windows and O_EXLOCK
#if HAVE_DECL_O_EXLOCK || defined BOX_OPEN_LOCK
// This works on platforms that have non-reentrant file locks (all but F_SETLK)
#ifndef BOX_LOCK_TYPE_F_SETLK
{
BackupStoreContext bsContext(0x01234567, (HousekeepingInterface *)NULL, "test");
bsContext.SetClientHasAccount("backup/01234567/", 0);
Expand Down
2 changes: 1 addition & 1 deletion test/backupstorepatch/testbackupstorepatch.cpp
Expand Up @@ -41,7 +41,7 @@
#include "Socket.h"
#include "SocketStreamTLS.h"
#include "StoreStructure.h"
#include "StoreTestUtils.h"
#include "StoreTestUtils.h" // for run_housekeeping()
#include "TLSContext.h"
#include "Test.h"

Expand Down
7 changes: 0 additions & 7 deletions test/httpserver/testhttpserver.cpp
Expand Up @@ -1126,13 +1126,6 @@ bool test_httpserver()
TEST_EQUAL(0, EMU_UNLINK("testfiles/store/newfile"));
}

// Copy testfiles/dsfdsfs98.fd to testfiles/store/dsfdsfs98.fd
{
FileStream in("testfiles/dsfdsfs98.fd", O_RDONLY);
FileStream out("testfiles/store/dsfdsfs98.fd", O_CREAT | O_WRONLY);
in.CopyStreamTo(out);
}

// S3Client tests with S3Simulator in-process server for debugging
{
S3Simulator simulator;
Expand Down

0 comments on commit b1cc966

Please sign in to comment.