Commit a6bbdbb5 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Merge branch '02_20_code_maintenance' into 'master'

02 20 code maintenance

General code maintenance:
- remove dead code
- remove as many `#define` as possible and use `constexpr` instead
- remove adafs occurrences and replace with gkfs
- reformat code to unify code style as of CPPCoreGuidelines
- rearrange imports, remove unused imports
- separate cmake configurations and FS configurations
- encapsulate non-prefix gkfs functions into namespaces
- change copyright statement to 2020
- cleanup of some irrelevant code and unnecessary struct definitions
- consistent renaming for rpc sender functions and create and remove functions from client to daemon
- encapsulate all code into namespaces even if naming and structuring is tentative

See merge request !31
parents 1ec0d0fd f05f1b46
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Intercept I/O syscalls instead of GlibC function using [syscall intercept library](https://github.com/pmem/syscall_intercept)

## [0.4.0] - 2019-04-18
First GekkoFS pubblic release
First GekkoFS public release

This version provides a client library that uses GLibC I/O function interception.

+2 −2
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ option(USE_SHM "Use shared memory for intra-node communication" OFF)
message(STATUS "[gekkofs] Shared-memory communication: ${USE_SHM}")

option(CREATE_CHECK_PARENTS "Check parent directory existance before creating child node" ON)
message(STATUS "Create checks parents: ${CREATE_CHECK_PARENTS}")
message(STATUS "[gekkofs] Create checks parents: ${CREATE_CHECK_PARENTS}")

option(SYMLINK_SUPPORT "Compile with support for symlinks" ON)
if(SYMLINK_SUPPORT)
@@ -146,7 +146,7 @@ add_definitions(-DLIBGKFS_LOG_MESSAGE_SIZE=${CLIENT_LOG_MESSAGE_SIZE})
message(STATUS "[gekkofs] Maximum log message size in the client library: ${CLIENT_LOG_MESSAGE_SIZE}")
mark_as_advanced(CLIENT_LOG_MESSAGE_SIZE)

configure_file(include/global/configure.hpp.in include/global/configure.hpp)
configure_file(include/global/cmake_configure.hpp.in include/global/cmake_configure.hpp)

# Imported target
add_library(RocksDB INTERFACE IMPORTED GLOBAL)
+2 −2
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ License-Text:

MIT License

Copyright (c) 2018-2019, Barcelona Supercomputing Center (BSC), Spain
Copyright (c) 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany
Copyright (c) 2018-2020, Barcelona Supercomputing Center (BSC), Spain
Copyright (c) 2015-2020, Johannes Gutenberg Universitaet Mainz, Germany

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+0 −82
Original line number Diff line number Diff line
/*
  Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).

  This software was partially supported by the
  ADA-FS project under the SPPEXA project funded by the DFG.

  SPDX-License-Identifier: MIT
*/

#ifndef IFS_ADAFS_FUNCTIONS_HPP
#define IFS_ADAFS_FUNCTIONS_HPP

#include <client/open_file_map.hpp>
#include <global/metadata.hpp>

std::shared_ptr<Metadata> adafs_metadata(const std::string& path, bool follow_links = false);

int adafs_open(const std::string& path, mode_t mode, int flags);

int check_parent_dir(const std::string& path);

int adafs_mk_node(const std::string& path, mode_t mode);

int check_parent_dir(const std::string& path);

int adafs_rm_node(const std::string& path);

int adafs_access(const std::string& path, int mask, bool follow_links = true);

int adafs_stat(const std::string& path, struct stat* buf, bool follow_links = true);

int adafs_statvfs(struct statvfs* buf);

int adafs_statfs(struct statfs* buf);

off64_t adafs_lseek(unsigned int fd, off64_t offset, unsigned int whence);

off64_t adafs_lseek(std::shared_ptr<OpenFile> adafs_fd, off64_t offset, unsigned int whence);

int adafs_truncate(const std::string& path, off_t offset);

int adafs_truncate(const std::string& path, off_t old_size, off_t new_size);

int adafs_dup(int oldfd);

int adafs_dup2(int oldfd, int newfd);

#ifdef HAS_SYMLINKS
int adafs_mk_symlink(const std::string& path, const std::string& target_path);
int adafs_readlink(const std::string& path, char *buf, int bufsize);
#endif


ssize_t adafs_pwrite(std::shared_ptr<OpenFile> file,
                     const char * buf, size_t count, off64_t offset);
ssize_t adafs_pwrite_ws(int fd, const void* buf, size_t count, off64_t offset);
ssize_t adafs_write(int fd, const void * buf, size_t count);
ssize_t adafs_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
ssize_t adafs_writev(int fd, const struct iovec * iov, int iovcnt);

ssize_t adafs_pread(std::shared_ptr<OpenFile> file, char * buf, size_t count, off64_t offset);
ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off64_t offset);
ssize_t adafs_read(int fd, void* buf, size_t count);


int adafs_opendir(const std::string& path);

int getdents(unsigned int fd,
             struct linux_dirent *dirp,
             unsigned int count);

int getdents64(unsigned int fd,
             struct linux_dirent64 *dirp,
             unsigned int count);

int adafs_rmdir(const std::string& path);

#endif //IFS_ADAFS_FUNCTIONS_HPP
+3 −3
Original line number Diff line number Diff line
/*
  Copyright 2018-2019, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2019, Johannes Gutenberg Universitaet Mainz, Germany
  Copyright 2018-2020, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2020, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
@@ -14,7 +14,7 @@
#ifndef GKFS_CLIENT_ENV
#define GKFS_CLIENT_ENV

#include <global/configure.hpp>
#include <config.hpp>

#define ADD_PREFIX(str) CLIENT_ENV_PREFIX str

Loading