mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
post-merge cleanup - remove copy&paste code in fil_node_t::find_metadata
This commit is contained in:
parent
a2a0adbfc3
commit
7a62b029b3
1 changed files with 8 additions and 17 deletions
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue