mirror of
https://github.com/isar/libmdbx.git
synced 2025-06-28 03:32:36 +08:00
mdbx: отключение использования copy_file_range()
для ядер linux 5.3-5.18 включительно.
This commit is contained in:
parent
56a6377622
commit
8d0eceee9f
@ -571,11 +571,17 @@ retry_snap_meta:
|
|||||||
uint8_t *const data_buffer = buffer + ceil_powerof2(meta_bytes, globals.sys_pagesize);
|
uint8_t *const data_buffer = buffer + ceil_powerof2(meta_bytes, globals.sys_pagesize);
|
||||||
#if MDBX_USE_COPYFILERANGE
|
#if MDBX_USE_COPYFILERANGE
|
||||||
static bool copyfilerange_unavailable;
|
static bool copyfilerange_unavailable;
|
||||||
|
#if (defined(__linux__) || defined(__gnu_linux__))
|
||||||
|
if (globals.linux_kernel_version >= 0x05030000 && globals.linux_kernel_version < 0x05130000)
|
||||||
|
copyfilerange_unavailable = true;
|
||||||
|
#endif /* linux */
|
||||||
bool not_the_same_filesystem = false;
|
bool not_the_same_filesystem = false;
|
||||||
struct statfs statfs_info;
|
if (!copyfilerange_unavailable) {
|
||||||
if (fstatfs(fd, &statfs_info) || statfs_info.f_type == /* ECRYPTFS_SUPER_MAGIC */ 0xf15f)
|
struct statfs statfs_info;
|
||||||
/* avoid use copyfilerange_unavailable() to ecryptfs due bugs */
|
if (fstatfs(fd, &statfs_info) || statfs_info.f_type == /* ECRYPTFS_SUPER_MAGIC */ 0xf15f)
|
||||||
not_the_same_filesystem = true;
|
/* avoid use copyfilerange_unavailable() to ecryptfs due bugs */
|
||||||
|
not_the_same_filesystem = true;
|
||||||
|
}
|
||||||
#endif /* MDBX_USE_COPYFILERANGE */
|
#endif /* MDBX_USE_COPYFILERANGE */
|
||||||
|
|
||||||
for (size_t offset = meta_bytes; rc == MDBX_SUCCESS && offset < used_size;) {
|
for (size_t offset = meta_bytes; rc == MDBX_SUCCESS && offset < used_size;) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user