Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Rename to fsck.sfs
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong committed Nov 3, 2023
1 parent ca919b5 commit 259c477
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ WORKDIR /src
RUN cmake -B /build /src \
&& cmake --build /build

FROM base as fsck.s3gw
FROM base as fsck.sfs

RUN zypper --non-interactive install \
libboost_program_options1_80_0 \
sqlite3 \
&& zypper clean --all

COPY --from=build /build/fsck.s3gw /usr/bin/fsck.s3gw
COPY --from=build /build/fsck.sfs /usr/bin/fsck.sfs

VOLUME /volume
ENTRYPOINT [ "/usr/bin/fsck.s3gw" ]
ENTRYPOINT [ "/usr/bin/fsck.sfs" ]
CMD [ "/volume" ]
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# fsck.s3gw
# fsck.sfs

fsck like tool to check for consistency problems on the backing store of the
[s3gw][1] and fix them
Expand Down Expand Up @@ -33,27 +33,27 @@ Must supply path to check.
Build the tool with CMake:

```shell
cd fsck.s3gw
cd fsck.sfs
cmake -S src -B build
cmake --build build
```

Run the tool you just built:

```shell
build/fsck.s3gw /path/to/s3gw/store
build/fsck.sfs /path/to/store
```

Or, build and run it in a container using Docker or Podman:

```shell
# Docker
docker build -t fsck.s3gw .
docker run -v /path/to/s3gw/store:/volume fsck.s3gw /volume
docker build -t fsck.sfs .
docker run -v /path/to/store:/volume fsck.sfs /volume

# Podman
podman build -t fsck.s3gw .
podman run -v /path/to/s3gw/store:/volume fsck.s3gw /volume
podman build -t fsck.sfs .
podman run -v /path/to/store:/volume fsck.sfs /volume
```

[1]: https://s3gw.io
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ find_program(CMAKE_CXX_COMPILER
PATHS /usr/bin
REQUIRED)

set(NAME fsck.s3gw)
set(NAME fsck.sfs)
project(${NAME} VERSION 0.0.1)

set(BOOST_COMPONENTS program_options)
Expand Down
6 changes: 3 additions & 3 deletions src/checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FSCK_S3GW_SRC_CHECKS_H__
#define FSCK_S3GW_SRC_CHECKS_H__
#ifndef FSCK_SFS_SRC_CHECKS_H__
#define FSCK_SFS_SRC_CHECKS_H__

#include <filesystem>
#include <memory>
Expand Down Expand Up @@ -50,4 +50,4 @@ class Check {

int run_checks(std::filesystem::path, bool);

#endif // FSCK_S3GW_SRC_CHECKS_H__
#endif // FSCK_SFS_SRC_CHECKS_H__
6 changes: 3 additions & 3 deletions src/checks/metadata_schema_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* in the expected version
*/

#ifndef FSCK_S3GW_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__
#define FSCK_S3GW_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__
#ifndef FSCK_SFS_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__
#define FSCK_SFS_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__

#include <filesystem>
#include <memory>
Expand Down Expand Up @@ -54,4 +54,4 @@ class MetadataSchemaVersionCheck : public Check {

const int EXPECTED_METADATA_SCHEMA_VERSION = 4;

#endif // FSCK_S3GW_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__
#endif // FSCK_SFS_SRC_CHECKS_METADATA_SCHEMA_VERSION_H__
2 changes: 1 addition & 1 deletion src/checks/object_integrity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int ObjectIntegrityCheck::check() {
std::string checksum{
reinterpret_cast<const char*>(sqlite3_column_text(stm, 2))};
std::uintmax_t object_size = sqlite3_column_int64(stm, 3);
// first/second/fname logic lifted from s3gw's UUIDPath class
// first/second/fname logic lifted from sfs's UUIDPath class
// *again* as we already did in OrphanedMetadataCheck
// TODO: dedupe this
std::filesystem::path first = uuid.substr(0, 2);
Expand Down
6 changes: 3 additions & 3 deletions src/checks/object_integrity.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* suggests it should be there, the fix will be to delete the metadata.
*/

#ifndef FSCK_S3GW_SRC_CHECKS_OBJECT_INTEGRITY_H__
#define FSCK_S3GW_SRC_CHECKS_OBJECT_INTEGRITY_H__
#ifndef FSCK_SFS_SRC_CHECKS_OBJECT_INTEGRITY_H__
#define FSCK_SFS_SRC_CHECKS_OBJECT_INTEGRITY_H__

#include "checks.h"
#include "sqlite.h"
Expand Down Expand Up @@ -53,4 +53,4 @@ class ObjectIntegrityCheck : public Check {
virtual int check() override;
};

#endif // FSCK_S3GW_SRC_CHECKS_OBJECT_INTEGRITY_H__
#endif // FSCK_SFS_SRC_CHECKS_OBJECT_INTEGRITY_H__
2 changes: 1 addition & 1 deletion src/checks/orphaned_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int OrphanedMetadataCheck::check() {
reinterpret_cast<const char*>(sqlite3_column_text(stm, 0))};
std::string id{reinterpret_cast<const char*>(sqlite3_column_text(stm, 1))};
id.append(".v");
// first/second/fname logic lifted from s3gw's UUIDPath class
// first/second/fname logic lifted from sfs's UUIDPath class
std::filesystem::path first = uuid.substr(0, 2);
std::filesystem::path second = uuid.substr(2, 2);
std::filesystem::path fname = uuid.substr(4);
Expand Down
6 changes: 3 additions & 3 deletions src/checks/orphaned_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* suggests it should be there, the fix will be to delete the metadata.
*/

#ifndef FSCK_S3GW_SRC_CHECKS_ORPHANED_METADATA_H__
#define FSCK_S3GW_SRC_CHECKS_ORPHANED_METADATA_H__
#ifndef FSCK_SFS_SRC_CHECKS_ORPHANED_METADATA_H__
#define FSCK_SFS_SRC_CHECKS_ORPHANED_METADATA_H__

#include <filesystem>
#include <memory>
Expand Down Expand Up @@ -55,4 +55,4 @@ class OrphanedMetadataCheck : public Check {
virtual int check() override;
};

#endif // FSCK_S3GW_SRC_CHECKS_ORPHANED_METADATA_H__
#endif // FSCK_SFS_SRC_CHECKS_ORPHANED_METADATA_H__
6 changes: 3 additions & 3 deletions src/checks/orphaned_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* and reviewed by a system administrator.
*/

#ifndef FSCK_S3GW_SRC_CHECKS_ORPHANED_OBJECTS_H__
#define FSCK_S3GW_SRC_CHECKS_ORPHANED_OBJECTS_H__
#ifndef FSCK_SFS_SRC_CHECKS_ORPHANED_OBJECTS_H__
#define FSCK_SFS_SRC_CHECKS_ORPHANED_OBJECTS_H__

#include <filesystem>
#include <memory>
Expand Down Expand Up @@ -70,4 +70,4 @@ class OrphanedObjectsCheck : public Check {
virtual int check() override;
};

#endif // FSCK_S3GW_SRC_CHECKS_ORPHANED_OBJECTS_H__
#endif // FSCK_SFS_SRC_CHECKS_ORPHANED_OBJECTS_H__
4 changes: 2 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* - - -
*
* fsck.s3gw
* fsck.sfs
*
* This program is used to check the filesystem backing the s3gw for consistency
* and if needed repair any fixable problems found. It is meant to be run
Expand Down Expand Up @@ -87,7 +87,7 @@ int main(int argc, char* argv[]) {
} else {
FSCK_ASSERT(
std::filesystem::exists(path_database),
"Metadata database not found (is this an s3gw volume?)"
"Metadata database not found (is this an sfs volume?)"
);
FSCK_ASSERT(
std::filesystem::is_regular_file(path_database),
Expand Down
6 changes: 3 additions & 3 deletions src/sqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* C++ helper bindings for SQLite.
*/

#ifndef FSCK_S3GW_SRC_SQLITE_H__
#define FSCK_S3GW_SRC_SQLITE_H__
#ifndef FSCK_SFS_SRC_SQLITE_H__
#define FSCK_SFS_SRC_SQLITE_H__

#include <sqlite3.h>

Expand All @@ -44,4 +44,4 @@ class Database {
std::vector<std::string> select_from_table(std::string, std::string);
};

#endif // FSCK_S3GW_SRC_SQLITE_H__
#endif // FSCK_SFS_SRC_SQLITE_H__

0 comments on commit 259c477

Please sign in to comment.