From 259c47751f4188b7cdeea2ca21a5b578bd85a3d3 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Fri, 3 Nov 2023 16:24:57 +1100 Subject: [PATCH] Rename to fsck.sfs Signed-off-by: Tim Serong --- Dockerfile | 6 +++--- README.md | 14 +++++++------- src/CMakeLists.txt | 2 +- src/checks.h | 6 +++--- src/checks/metadata_schema_version.h | 6 +++--- src/checks/object_integrity.cc | 2 +- src/checks/object_integrity.h | 6 +++--- src/checks/orphaned_metadata.cc | 2 +- src/checks/orphaned_metadata.h | 6 +++--- src/checks/orphaned_objects.h | 6 +++--- src/main.cc | 4 ++-- src/sqlite.h | 6 +++--- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index be90164..21285f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/README.md b/README.md index 6a04954..b0d48a0 100644 --- a/README.md +++ b/README.md @@ -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 @@ -33,7 +33,7 @@ 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 ``` @@ -41,19 +41,19 @@ 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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b962fe..8f86168 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/checks.h b/src/checks.h index e2eb954..92afbc3 100644 --- a/src/checks.h +++ b/src/checks.h @@ -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 #include @@ -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__ diff --git a/src/checks/metadata_schema_version.h b/src/checks/metadata_schema_version.h index ef1634e..e866c9d 100644 --- a/src/checks/metadata_schema_version.h +++ b/src/checks/metadata_schema_version.h @@ -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 #include @@ -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__ diff --git a/src/checks/object_integrity.cc b/src/checks/object_integrity.cc index 77fbaa8..d64441c 100644 --- a/src/checks/object_integrity.cc +++ b/src/checks/object_integrity.cc @@ -66,7 +66,7 @@ int ObjectIntegrityCheck::check() { std::string checksum{ reinterpret_cast(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); diff --git a/src/checks/object_integrity.h b/src/checks/object_integrity.h index 7695cba..85c981e 100644 --- a/src/checks/object_integrity.h +++ b/src/checks/object_integrity.h @@ -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" @@ -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__ diff --git a/src/checks/orphaned_metadata.cc b/src/checks/orphaned_metadata.cc index 839ce66..5ce2043 100644 --- a/src/checks/orphaned_metadata.cc +++ b/src/checks/orphaned_metadata.cc @@ -67,7 +67,7 @@ int OrphanedMetadataCheck::check() { reinterpret_cast(sqlite3_column_text(stm, 0))}; std::string id{reinterpret_cast(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); diff --git a/src/checks/orphaned_metadata.h b/src/checks/orphaned_metadata.h index 92d312e..93e908e 100644 --- a/src/checks/orphaned_metadata.h +++ b/src/checks/orphaned_metadata.h @@ -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 #include @@ -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__ diff --git a/src/checks/orphaned_objects.h b/src/checks/orphaned_objects.h index 0f3afa5..f7aa018 100644 --- a/src/checks/orphaned_objects.h +++ b/src/checks/orphaned_objects.h @@ -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 #include @@ -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__ diff --git a/src/main.cc b/src/main.cc index 9400dd7..a181e5a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 @@ -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), diff --git a/src/sqlite.h b/src/sqlite.h index 9dfb4a9..d2a4b19 100644 --- a/src/sqlite.h +++ b/src/sqlite.h @@ -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 @@ -44,4 +44,4 @@ class Database { std::vector select_from_table(std::string, std::string); }; -#endif // FSCK_S3GW_SRC_SQLITE_H__ +#endif // FSCK_SFS_SRC_SQLITE_H__