Commit 5e8efca3 authored by Ramon Nou's avatar Ramon Nou
Browse files

Full stage-out support for adhoc-fs (gekkoFS)

parent fa560be0
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -180,12 +180,12 @@ public:

    std::size_t
    size() const noexcept {
        return std::filesystem::file_size(m_path);
        return m_fs_plugin->size(m_path);
    }

    auto
    remove() noexcept {
        return std::filesystem::remove(m_path);
        return m_fs_plugin->unlink(m_path);
    }

    void
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ public:
    unlink(const std::string& path) = 0;
    virtual int
    stat(const std::string& path, struct stat* buf) = 0;
    virtual ssize_t
    size(const std::string& path) = 0;
};
} // namespace cargo
#endif // FS_PLUGIN_HPP
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
@@ -97,5 +97,15 @@ gekko_plugin::stat(const std::string& path, struct stat* buf) {
    return gkfs::syscall::gkfs_stat(path, buf);
}

ssize_t
gekko_plugin::size(const std::string& path) {
    struct stat buf;
    int res = gekko_plugin::stat(path, &buf);
    if(res != 0) {
        return -1;
    }
    return buf.st_size;
}


} // namespace cargo
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ public:
    unlink(const std::string& path) final;
    int
    stat(const std::string& path, struct stat* buf) final;
    ssize_t
    size(const std::string& path) final;
};
}; // namespace cargo

+4 −0
Original line number Diff line number Diff line
@@ -66,5 +66,9 @@ posix_plugin::stat(const std::string& path, struct stat* buf) {
    return ::stat(path.c_str(), buf);
}

ssize_t
posix_plugin::size(const std::string& path) {
    return std::filesystem::file_size(path);
}

}; // namespace cargo
 No newline at end of file
Loading