Commit ad3f4968 authored by Julius Athenstaedt's avatar Julius Athenstaedt
Browse files

calculates blocksize by dividing size / 512 as it is legacy in the linux...

calculates blocksize by dividing size / 512 as it is legacy in the linux kernel, only if renaming is deactivated
parent 0ba03e5f
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -66,4 +66,11 @@ constexpr auto na_sm = "na+sm";
} // namespace protocol
} // namespace gkfs::rpc

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

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