Verified Commit da745184 authored by Marc Vef's avatar Marc Vef
Browse files

optimizing path resolution performance


Moving path code from preload context, updating hooks.cpp with new method

tmp
parent 43f24116
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -17,11 +17,23 @@
namespace gkfs {
namespace path {

enum class NormalizeStatus {
    ok,
    fd_unknown,
    fd_not_a_dir
};

unsigned int match_components(const std::string& path, unsigned int& path_components,
                              const std::vector<std::string>& components);

bool resolve(const std::string& path, std::string& resolved, bool resolve_last_link = true);

NormalizeStatus normalize(int dirfd, const char* raw_path, std::string& normalized_path, bool resolve_last_link = true);

std::string normalize(const char* raw_path, bool resolve_last_link = true);

bool is_in_gkfs(std::string& path, bool cut_mountdir_prefix = false);

std::string get_sys_cwd();

void set_sys_cwd(const std::string& path);
+0 −14
Original line number Diff line number Diff line
@@ -54,13 +54,6 @@ struct FsConfig {

};

enum class RelativizeStatus {
    internal,
    external,
    fd_unknown,
    fd_not_a_dir
};

/**
 * Singleton class of the client context with all relevant global data
 */
@@ -137,13 +130,6 @@ public:

    void auto_sm(bool auto_sm);

    RelativizeStatus relativize_fd_path(int dirfd,
                                        const char* raw_path,
                                        std::string& relative_path,
                                        bool resolve_last_link = true) const;

    bool relativize_path(const char* raw_path, std::string& relative_path, bool resolve_last_link = true) const;

    const std::shared_ptr<gkfs::filemap::OpenFileMap>& file_map() const;

    void distributor(std::shared_ptr<gkfs::rpc::Distributor> distributor);
+9 −0
Original line number Diff line number Diff line
@@ -69,6 +69,15 @@ namespace rocksdb {
constexpr auto use_write_ahead_log = false;
} // namespace rocksdb

namespace preload {
/*
 * This option allows a symlink outside of the GekkoFS namespace into the GekkoFS namespace.
 * This is by default disabled as it incurs a significant overhead during GekkoFS' path resolution.
 * Therefore, it is recommended to keep it disabled
 */
constexpr auto allow_symlinks_into_gkfs = false;
}

} // namespace gkfs
} // namespace config

+200 −176

File changed.

Preview size limit exceeded, changes collapsed.

+189 −46

File changed.

Preview size limit exceeded, changes collapsed.

Loading