Commit 8d65f46b authored by Ramon Nou's avatar Ramon Nou
Browse files

add linux dirent 64 bits

parent 09d71ad1
Loading
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -75,9 +75,15 @@ using namespace std;
 * kernel: fs/readdir.c.
 */
struct linux_dirent {
#ifndef __USE_FILE_OFFSET64
    unsigned long d_ino;
    unsigned long d_off;
#else
    uint64_t d_ino;
    int64_t d_off;
#endif
    unsigned short d_reclen;
    unsigned char d_type; // Does it break dirents?
    char d_name[1];
};
/*
@@ -149,7 +155,6 @@ namespace gkfs::syscall {
 */
int
gkfs_open(const std::string& path, mode_t mode, int flags) {

    // metadata object filled during create or stat
    gkfs::metadata::Metadata md{};
    if(flags & O_CREAT) {
@@ -1499,7 +1504,7 @@ gkfs_getdents(unsigned int fd, struct linux_dirent* dirp, unsigned int count) {

        current_dirp->d_reclen = total_size;

        *(reinterpret_cast<char*>(current_dirp) + total_size - 1) =
        current_dirp->d_type =
                ((de.type() == gkfs::filemap::FileType::regular) ? DT_REG
                                                                 : DT_DIR);