提交 61ee286f 编写于 作者: O obdev 提交者: wangzelin.wzl

Fix FALLOC_FL_PUNCH_HOLE not defined when glibc version is low

上级 ae0ace66
......@@ -1036,7 +1036,9 @@ void ObStoreFile::free_block(const uint32_t block_idx, bool& is_freed)
free_block_push_pos_ = (free_block_push_pos_ + 1) % store_file_system_->get_total_macro_block_count();
++free_block_cnt_;
// punch hole
// FALLOC_FL_PUNCH_HOLE is only supported after glibc-2.17
// https://bugzilla.redhat.com/show_bug.cgi?id=1476120
# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17))
if (is_fs_support_punch_hole_ && GCONF._enable_block_file_punch_hole) {
const int64_t len = store_file_system_->get_macro_block_size();
const int64_t offset = store_file_system_->get_macro_block_size() * block_idx;
......@@ -1056,6 +1058,7 @@ void ObStoreFile::free_block(const uint32_t block_idx, bool& is_freed)
SHARE_LOG(INFO, "Punch hole success", K(block_idx), K(offset), K(len));
}
}
#endif
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册