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

Merge branch 'jathenst/261-du-doesn-t-show-size' into 'master'

Resolve "du doesn't show size"

Closes #261

Closes #261

See merge request !177
parents 0ba03e5f e227163b
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -66,4 +66,9 @@ constexpr auto na_sm = "na+sm";
} // namespace protocol
} // namespace gkfs::rpc

namespace gkfs::config::syscall::stat {
// Number 512-byte blocks allocated as it is in the linux kernel (struct_stat.h)
constexpr auto st_nblocksize = 512;
} // namespace gkfs::config::syscall::stat

#endif // GEKKOFS_COMMON_DEFS_HPP
+3 −2
Original line number Diff line number Diff line
@@ -268,9 +268,10 @@ metadata_to_stat(const std::string& path, const gkfs::metadata::Metadata& md,
    if(CTX->fs_conf()->link_cnt_state) {
        attr.st_nlink = md.link_count();
    }
    if(CTX->fs_conf()->blocks_state) { // last one will not encounter a
                                       // delimiter anymore
    if(CTX->fs_conf()->blocks_state) {
        attr.st_blocks = md.blocks();
    } else {
        attr.st_blocks = md.size() / gkfs::config::syscall::stat::st_nblocksize;
    }
    return 0;
}