Commit 39840ca1 authored by Julius Athenstaedt's avatar Julius Athenstaedt
Browse files

GKFS_ prefix for CREATE_CHECK_PARENTS

parent 9efd7f44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Paths inside kernel pseudo filesystems (`/sys`, `/proc`) are forwarded directly to the kernel and internal path
  resolution will be skipped. Be aware that also paths like  `/sys/../tmp/gkfs_mountpoint/asd` will be forwarded to the
  kernel
- Added new Cmake flag `CREATE_CHECK_PARENTS` to controls if the existance of the parent node needs to be checked during
- Added new Cmake flag `GKFS_CREATE_CHECK_PARENTS` to controls if the existance of the parent node needs to be checked during
  the creation of a child node.

### Changed
+1 −3
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"
+1 −1
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
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
+1 −1
Original line number Diff line number Diff line
@@ -813,7 +813,7 @@ main(int argc, const char* argv[]) {
#else
        cout << "Debug: OFF" << endl;
#endif
#if CREATE_CHECK_PARENTS
#if GKFS_CREATE_CHECK_PARENTS
        cout << "Create check parents: ON" << endl;
#else
        cout << "Create check parents: OFF" << endl;