Resolve "Add GKFS_ prefix to CMake options"

Closes #129 (closed)

Merge request reports

Loading
+5 −11
Changes for CMake/gkfs-options.cmake: 5 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -235,16 +235,14 @@ cmake_dependent_option(GKFS_INSTALL_TESTS "Install GekkoFS self tests" OFF "GKFS
################################################################################

## check before create
# FIXME: should be prefixed with GKFS_
gkfs_define_option(
  CREATE_CHECK_PARENTS
  GKFS_CREATE_CHECK_PARENTS
  HELP_TEXT "Enable checking parent directory for existence before creating children"
  DEFAULT_VALUE ON
  DESCRIPTION "Verify that a parent directory exists before creating new files or directories"
)

## symbolic link support
# FIXME: should be prefixed with GKFS_
gkfs_define_option(
  GKFS_SYMLINK_SUPPORT
  HELP_TEXT "Enable support for symlinks"
@@ -266,13 +264,11 @@ gkfs_define_option(
################################################################################

## Maximum number of internal file descriptors reserved for GekkoFS
# FIXME: should be prefixed with GKFS_
gkfs_define_variable(MAX_INTERNAL_FDS 256
gkfs_define_variable(GKFS_MAX_INTERNAL_FDS 256
  STRING "Number of file descriptors reserved for internal use" ADVANCED
)

## Maximum number of open file descriptors for GekkoFS
# FIXME: should be prefixed with GKFS_
execute_process(COMMAND getconf OPEN_MAX
  OUTPUT_VARIABLE _GETCONF_MAX_FDS
  OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -282,7 +278,7 @@ if (NOT _GETCONF_MAX_FDS)
endif ()

gkfs_define_variable(
  MAX_OPEN_FDS
  GKFS_MAX_OPEN_FDS
  ${_GETCONF_MAX_FDS}
  STRING
  "Maximum number of open file descriptors supported"
@@ -326,15 +322,13 @@ gkfs_define_option(
################################################################################

## Client logging support
# FIXME: should be prefixed with GKFS_
gkfs_define_option(
  ENABLE_CLIENT_LOG HELP_TEXT "Enable logging messages in clients"
  GKFS_ENABLE_CLIENT_LOG HELP_TEXT "Enable logging messages in clients"
  DEFAULT_VALUE ON
)

# FIXME: should be prefixed with GKFS_
gkfs_define_variable(
  CLIENT_LOG_MESSAGE_SIZE
  GKFS_CLIENT_LOG_MESSAGE_SIZE
  1024
  STRING
  "Maximum size of a log message in the client library"
+2 −2
Changes for docs/sphinx/devs/coverage.md: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ that greatly simplify this process. Thus, GekkoFS provides a CMake
$ cmake --preset=default-coverage
Preset CMake variables:

  CLIENT_LOG_MESSAGE_SIZE="512"
  CMAKE_BUILD_TYPE="Coverage"
  CMAKE_CXX_COMPILER="/usr/bin/g++"
  CMAKE_CXX_FLAGS="-Wall -Wextra -fdiagnostics-color=always --pedantic -Wno-unused-parameter -Wno-missing-field-initializers -DGKFS_DEBUG_BUILD -DHERMES_DEBUG_BUILD"
@@ -59,7 +58,8 @@ Preset CMake variables:
  CMAKE_EXE_LINKER_FLAGS_COVERAGE="--coverage"
  CMAKE_MAP_IMPORTED_CONFIG_COVERAGE="Coverage;RelWithDebInfo;Release;Debug;"
  CMAKE_SHARED_LINKER_FLAGS_COVERAGE="--coverage"
  ENABLE_CLIENT_LOG:BOOL="TRUE"
  GKFS_CLIENT_LOG_MESSAGE_SIZE="512"
  GKFS_ENABLE_CLIENT_LOG:BOOL="TRUE"
  GKFS_BUILD_DOCUMENTATION:BOOL="TRUE"
  GKFS_BUILD_TESTS:BOOL="TRUE"
  GKFS_CHUNK_STATS:BOOL="TRUE"
+3 −2
Changes for include/client/preload_context.hpp: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ enum class RelativizeStatus { internal, external, fd_unknown, fd_not_a_dir };
 */
class PreloadContext {

    static auto constexpr MIN_INTERNAL_FD = MAX_OPEN_FDS - MAX_INTERNAL_FDS;
    static auto constexpr MIN_INTERNAL_FD =
            GKFS_MAX_OPEN_FDS - GKFS_MAX_INTERNAL_FDS;
    static auto constexpr MAX_USER_FDS = MIN_INTERNAL_FD;

private:
@@ -99,7 +100,7 @@ private:

    bool interception_enabled_;

    std::bitset<MAX_INTERNAL_FDS> internal_fds_;
    std::bitset<GKFS_MAX_INTERNAL_FDS> internal_fds_;
    mutable std::mutex internal_fds_mutex_;
    bool internal_fds_must_relocate_;
    std::bitset<MAX_USER_FDS> protected_fds_;
+1 −1
Changes for include/common/cmake_configure.hpp.in: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#ifndef GKFS_CMAKE_CONFIGURE_HPP
#define GKFS_CMAKE_CONFIGURE_HPP

#cmakedefine01 CREATE_CHECK_PARENTS
#cmakedefine01 GKFS_CREATE_CHECK_PARENTS
#cmakedefine01 LOG_SYSCALLS
#cmakedefine GKFS_USE_GUIDED_DISTRIBUTION
#define GKFS_USE_GUIDED_DISTRIBUTION_PATH "@GKFS_USE_GUIDED_DISTRIBUTION_PATH@"
+3 −3
Changes for src/client/gkfs_functions.cpp: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -91,13 +91,13 @@ namespace {

/**
 * Checks if metadata for parent directory exists (can be disabled with
 * CREATE_CHECK_PARENTS). errno may be set
 * GKFS_CREATE_CHECK_PARENTS). errno may be set
 * @param path
 * @return 0 on success, -1 on failure
 */
int
check_parent_dir(const std::string& path) {
#if CREATE_CHECK_PARENTS
#if GKFS_CREATE_CHECK_PARENTS
    auto p_comp = gkfs::path::dirname(path);
    auto md = gkfs::utils::get_metadata(p_comp);
    if(!md) {
@@ -114,7 +114,7 @@ check_parent_dir(const std::string& path) {
        errno = ENOTDIR;
        return -1;
    }
#endif // CREATE_CHECK_PARENTS
#endif // GKFS_CREATE_CHECK_PARENTS
    return 0;
}
} // namespace
Loading
Loading