Commit dee19edc authored by Marc Vef's avatar Marc Vef
Browse files

Adding gkfs::filemap for OpenFileMap, OpenFile, DirEntry, OpenDir classes

parent 75a623eb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ int gkfs_statvfs(sys_statvfs* buf);

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

off64_t gkfs_lseek(std::shared_ptr<OpenFile> gkfs_fd, off64_t offset, unsigned int whence);
off64_t gkfs_lseek(std::shared_ptr<gkfs::filemap::OpenFile> gkfs_fd, off64_t offset, unsigned int whence);

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

@@ -72,7 +72,7 @@ int gkfs_readlink(const std::string& path, char* buf, int bufsize);

#endif

ssize_t gkfs_pwrite(std::shared_ptr<OpenFile> file,
ssize_t gkfs_pwrite(std::shared_ptr<gkfs::filemap::OpenFile> file,
                    const char* buf, size_t count, off64_t offset);

ssize_t gkfs_pwrite_ws(int fd, const void* buf, size_t count, off64_t offset);
@@ -83,7 +83,7 @@ ssize_t gkfs_pwritev(int fd, const struct iovec* iov, int iovcnt, off_t offset);

ssize_t gkfs_writev(int fd, const struct iovec* iov, int iovcnt);

ssize_t gkfs_pread(std::shared_ptr<OpenFile> file, char* buf, size_t count, off64_t offset);
ssize_t gkfs_pread(std::shared_ptr<gkfs::filemap::OpenFile> file, char* buf, size_t count, off64_t offset);

ssize_t gkfs_pread_ws(int fd, void* buf, size_t count, off64_t offset);

+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@

#include <client/open_file_map.hpp>

namespace gkfs {
namespace filemap {

class DirEntry {
private:
@@ -50,5 +52,7 @@ public:
    size_t size();
};

} // namespace filemap
} // namespace gkfs

#endif //GEKKOFS_OPEN_DIR_HPP
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@
#include <memory>
#include <atomic>

namespace gkfs {
namespace filemap {

/* Forward declaration */
class OpenDir;

@@ -115,5 +118,7 @@ public:
    int get_fd_idx();
};

} // namespace filemap
} // namespace gkfs

#endif //GEKKOFS_OPEN_FILE_MAP_HPP
+6 −4
Original line number Diff line number Diff line
@@ -24,10 +24,12 @@
#include <bitset>

/* Forward declarations */
class OpenFileMap;
namespace gkfs {

namespace filemap {
class OpenFileMap;
}

namespace gkfs {
namespace rpc {
class Distributor;
}
@@ -66,7 +68,7 @@ class PreloadContext {
private:
    PreloadContext();

    std::shared_ptr<OpenFileMap> ofm_;
    std::shared_ptr<gkfs::filemap::OpenFileMap> ofm_;
    std::shared_ptr<gkfs::rpc::Distributor> distributor_;
    std::shared_ptr<FsConfig> fs_conf_;

@@ -124,7 +126,7 @@ public:

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

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

    void distributor(std::shared_ptr<gkfs::rpc::Distributor> distributor);

+9 −4
Original line number Diff line number Diff line
@@ -20,11 +20,15 @@
/* Forward declaration */
struct MetadentryUpdateFlags;

class OpenDir;

namespace gkfs {
namespace filemap {
class OpenDir;
}
namespace metadata {
class Metadata;
}

namespace gkfs {
namespace rpc {

int forward_create(const std::string& path, mode_t mode);
@@ -35,14 +39,15 @@ int forward_remove(const std::string& path, bool remove_metadentry_only, ssize_t

int forward_decr_size(const std::string& path, size_t length);

int forward_update_metadentry(const std::string& path, const Metadata& md, const MetadentryUpdateFlags& md_flags);
int forward_update_metadentry(const std::string& path, const gkfs::metadata::Metadata& md,
                              const MetadentryUpdateFlags& md_flags);

int forward_update_metadentry_size(const std::string& path, size_t size, off64_t offset, bool append_flag,
                                   off64_t& ret_size);

int forward_get_metadentry_size(const std::string& path, off64_t& ret_size);

void forward_get_dirents(OpenDir& open_dir);
void forward_get_dirents(gkfs::filemap::OpenDir& open_dir);

#ifdef HAS_SYMLINKS

Loading