Verified Commit 544483af authored by Marc Vef's avatar Marc Vef
Browse files

MERGE: on master (0.7)

parent f6fc6149
Loading
Loading
Loading
Loading
+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
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@

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

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

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

int gkfs_mk_node(const std::string& path, mode_t mode);
+2 −0
Original line number Diff line number Diff line
@@ -16,5 +16,7 @@

#define RPC_PROTOCOL "@RPC_PROTOCOL@"
#cmakedefine01 USE_SHM
#cmakedefine01 CREATE_CHECK_PARENTS
#cmakedefine01 LOG_SYSCALLS

#endif //FS_CMAKE_CONFIGURE_H

include/global/configure.hpp.in

deleted100644 → 0
+0 −77
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 GKFS_CONFIGURE_HPP
#define GKFS_CONFIGURE_HPP


#define RPC_PROTOCOL "@RPC_PROTOCOL@"
#cmakedefine01 USE_SHM
#cmakedefine01 CREATE_CHECK_PARENTS

#define CHUNKSIZE 524288 // in bytes 512KB

// What metadata is used
#define MDATA_USE_ATIME false
#define MDATA_USE_MTIME false
#define MDATA_USE_CTIME false
#define MDATA_USE_LINK_CNT false
#define MDATA_USE_BLOCKS false

/*
 * Zero buffer before read. This is relevant if sparse files are used.
 * If buffer is not zeroed, sparse regions contain invalid data.
 */
//#define ZERO_BUFFER_BEFORE_READ

// Write-ahead logging of rocksdb
#define KV_WOL false

// Buffer size for Rocksdb. A high number means that all entries are held in memory.
// However, when full the application blocks until **all** entries are flushed to disk.
//#define KV_WRITE_BUFFER 16384

// Margo and Argobots configuration

/*
 * Indicates the number of concurrent progress to drive I/O operations of chunk files to and from local file systems
 * The value is directly mapped to created Argobots xstreams, controlled in a single pool with ABT_snoozer scheduler
 */
#define DAEMON_IO_XSTREAMS 8
// Number of threads used for RPC handlers at the daemon
#define DAEMON_RPC_HANDLER_XSTREAMS 8
#define DEFAULT_RPC_PORT 4433
#define RPC_TRIES 3
// rpc timeout to try again in milliseconds
#define RPC_TIMEOUT 3000

#define DEFAULT_HOSTS_FILE "./gkfs_hosts.txt"

//size of preallocated buffer to hold directory entries in rpc call
#define RPC_DIRENTS_BUFF_SIZE (8 * 1024 * 1024) // 8 mega

// environment prefixes
#define CLIENT_ENV_PREFIX "LIBGKFS_"
#define DAEMON_ENV_PREFIX "GKFS_"

// Log
#define DEFAULT_DAEMON_PID_PATH "/tmp/gkfs_daemon"
#define DEFAULT_CLIENT_LOG_PATH "/tmp/gkfs_client.log"
#define DEFAULT_DAEMON_LOG_PATH "/tmp/gkfs_daemon.log"

#define DEFAULT_CLIENT_LOG_LEVEL "info,errors,critical,mercury"
#define DEFAULT_DAEMON_LOG_LEVEL 4 // info

#cmakedefine01 LOG_SYSCALLS

#endif //FS_CONFIGURE_H
Loading