Verified Commit 8adc4d68 authored by Marc Vef's avatar Marc Vef
Browse files

Merged main.cpp into adafs_daemon.cpp, proper separation of daemon and library, cleanup

parent d6d5fe12
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -120,26 +120,24 @@ include_directories(
add_subdirectory(src/preload)

set(DAEMON_SRC
    main.cpp
    src/global/rpc/rpc_utils.cpp
    src/daemon/adafs_daemon.cpp
    src/daemon/db/db_util.cpp
    src/daemon/db/db_ops.cpp
    src/daemon/adafs_ops/data.cpp
    src/daemon/adafs_ops/metadentry.cpp
    src/daemon/classes/fs_data.cpp
    src/daemon/classes/rpc_data.cpp
    src/daemon/classes/metadata.cpp
    src/daemon/adafs_ops/data.cpp
    src/daemon/adafs_ops/metadentry.cpp
    src/daemon/db/db_util.cpp
    src/daemon/db/db_ops.cpp
    src/daemon/handler/h_metadentry.cpp
    src/daemon/handler/h_data.cpp
    src/daemon/handler/h_preload.cpp
    src/global/rpc/rpc_utils.cpp
    )
set(DAEMON_HEADERS
    main.hpp
    configure_public.hpp
    include/global/configure.hpp
    include/global/global_defs.hpp
    include/global/rpc/rpc_defs.hpp
    include/global/rpc/ipc_types.hpp
    include/global/rpc/rpc_types.hpp
    include/global/rpc/rpc_utils.hpp
    include/daemon/adafs_daemon.hpp
@@ -150,6 +148,7 @@ set(DAEMON_HEADERS
    include/daemon/classes/rpc_data.hpp
    include/daemon/db/db_ops.hpp
    include/daemon/db/db_util.hpp
    include/daemon/handler/rpc_defs.hpp
    )
add_executable(adafs_daemon ${DAEMON_SRC} ${DAEMON_HEADERS})
# define target specific directory includes
+44 −1
Original line number Diff line number Diff line
@@ -2,7 +2,48 @@
#ifndef IFS_ADAFS_DAEMON_HPP
#define IFS_ADAFS_DAEMON_HPP

#include "../../main.hpp"
// std libs
#include <string>
#include <iostream>
#include <cstdint>
#include <cerrno>
#include <unordered_map>
#include <thread>
#include <map>

// adafs config
#include <global/configure.hpp>
#include <global/global_defs.hpp>
// boost libs
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/program_options.hpp>
#include <boost/tokenizer.hpp>
// third party libs
#include <extern/spdlog/spdlog.h>
#include <extern/spdlog/fmt/fmt.h>
// rocksdb
#include <rocksdb/db.h>
#include <rocksdb/slice.h>
#include <rocksdb/options.h>
#include <rocksdb/utilities/transaction.h>
#include <rocksdb/utilities/optimistic_transaction_db.h>
#include <rocksdb/write_batch.h>
// margo
extern "C" {
#include <abt.h>
#include <mercury.h>
#include <margo.h>
}
// adafs
#include <daemon/classes/fs_data.hpp>
#include <daemon/classes/rpc_data.hpp>

namespace bfs = boost::filesystem;

#define INVALID_INODE static_cast<ino_t>(0)
#define ADAFS_DATA (static_cast<FsData*>(FsData::getInstance()))
#define RPC_DATA (static_cast<RPCData*>(RPCData::getInstance()))

bool init_environment();
void destroy_enviroment();
@@ -18,4 +59,6 @@ bool register_daemon_proc();

bool deregister_daemon_proc();

std::string get_my_hostname(bool short_hostname);

#endif //IFS_ADAFS_DAEMON_HPP
+1 −2
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@
#ifndef IFS_DATA_HPP
#define IFS_DATA_HPP

#include "../../../main.hpp"
#include <preload/preload_util.hpp>
#include <daemon/adafs_daemon.hpp>

std::string path_to_fspath(const std::string& path);

+1 −1
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@
#ifndef IFS_METADENTRY_HPP
#define IFS_METADENTRY_HPP

#include <daemon/adafs_daemon.hpp>
#include <daemon/classes/metadata.hpp>
#include "../../../main.hpp"

int create_node(const std::string& path, const uid_t uid, const gid_t gid, mode_t mode);

+1 −2
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@
#ifndef LFS_FS_DATA_H
#define LFS_FS_DATA_H

#include "../../../main.hpp"
#include <map>
#include <daemon/adafs_daemon.hpp>


class FsData {
Loading