Loading include/common/common_defs.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -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 src/client/preload_util.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading
include/common/common_defs.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -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
src/client/preload_util.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading