post-merge cleanup - remove copy&paste code in fil_node_t::find_metadata

This commit is contained in:
Vladislav Vaintroub 2024-11-05 17:36:28 +01:00
parent a2a0adbfc3
commit 7a62b029b3

View file

@ -3947,23 +3947,6 @@ void fil_node_t::find_metadata(IF_WIN(,bool create)) noexcept
punch_hole= 2;
else
punch_hole= IF_WIN(, !create ||) os_is_sparse_file_supported(file);
#ifdef _WIN32
on_ssd= is_file_on_ssd(file, name);
FILE_STORAGE_INFO info;
if (GetFileInformationByHandleEx(file, FileStorageInfo, &info, sizeof info))
block_size= info.PhysicalBytesPerSectorForAtomicity;
else
block_size= 512;
if (space->purpose != FIL_TYPE_TABLESPACE)
{
/* For temporary tablespace or during IMPORT TABLESPACE, we
disable neighbour flushing and do not care about atomicity. */
on_ssd= true;
atomic_write= true;
return;
}
#else
if (space->purpose != FIL_TYPE_TABLESPACE)
{
/* For temporary tablespace or during IMPORT TABLESPACE, we
@ -3973,6 +3956,14 @@ void fil_node_t::find_metadata(IF_WIN(,bool create)) noexcept
if (space->purpose == FIL_TYPE_TEMPORARY || !space->is_compressed())
return;
}
#ifdef _WIN32
on_ssd= is_file_on_ssd(file, name);
FILE_STORAGE_INFO info;
if (GetFileInformationByHandleEx(file, FileStorageInfo, &info, sizeof info))
block_size= info.PhysicalBytesPerSectorForAtomicity;
else
block_size= 512;
#else
struct stat statbuf;
if (!fstat(file, &statbuf))
{