Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3a3605f4
Commit
3a3605f4
authored
Jan 08, 2020
by
Eugene Kosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-21382 fix compilation without perfschema plugin
parent
9cd6b230
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
storage/innobase/include/os0file.h
storage/innobase/include/os0file.h
+11
-0
storage/innobase/os/os0file.cc
storage/innobase/os/os0file.cc
+14
-8
No files found.
storage/innobase/include/os0file.h
View file @
3a3605f4
...
@@ -1141,6 +1141,9 @@ to original un-instrumented file I/O APIs */
...
@@ -1141,6 +1141,9 @@ to original un-instrumented file I/O APIs */
# define os_file_flush(file) os_file_flush_func(file)
# define os_file_flush(file) os_file_flush_func(file)
#define os_file_flush_data(file) \
pfs_os_file_flush_data_func(file, __FILE__, __LINE__)
# define os_file_rename(key, oldpath, newpath) \
# define os_file_rename(key, oldpath, newpath) \
os_file_rename_func(oldpath, newpath)
os_file_rename_func(oldpath, newpath)
...
@@ -1220,6 +1223,14 @@ bool
...
@@ -1220,6 +1223,14 @@ bool
os_file_flush_func
(
os_file_flush_func
(
os_file_t
file
);
os_file_t
file
);
/** NOTE! Use the corresponding macro os_file_flush_data(), not directly this
function!
Flushes only(!) data (excluding metadata) from OS page cache of a given file to
the disk.
@param[in] file handle to a file
@return true if success */
bool
os_file_flush_data_func
(
os_file_t
file
);
/** Retrieves the last error number if an error occurs in a file io function.
/** Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
overwrite the error number). If the number is not known to this program,
...
...
storage/innobase/os/os0file.cc
View file @
3a3605f4
...
@@ -4615,6 +4615,18 @@ os_normalize_path(
...
@@ -4615,6 +4615,18 @@ os_normalize_path(
}
}
}
}
bool
os_file_flush_data_func
(
os_file_t
file
)
{
#ifdef _WIN32
return
os_file_flush_func
(
file
);
#else
bool
success
=
fdatasync
(
file
)
!=
-
1
;
if
(
!
success
)
{
ib
::
error
()
<<
"fdatasync() errno: "
<<
errno
;
}
return
success
;
#endif
}
bool
pfs_os_file_flush_data_func
(
pfs_os_file_t
file
,
const
char
*
src_file
,
bool
pfs_os_file_flush_data_func
(
pfs_os_file_t
file
,
const
char
*
src_file
,
uint
src_line
)
uint
src_line
)
{
{
...
@@ -4624,14 +4636,8 @@ bool pfs_os_file_flush_data_func(pfs_os_file_t file, const char *src_file,
...
@@ -4624,14 +4636,8 @@ bool pfs_os_file_flush_data_func(pfs_os_file_t file, const char *src_file,
register_pfs_file_io_begin
(
&
state
,
locker
,
file
,
0
,
PSI_FILE_SYNC
,
src_file
,
register_pfs_file_io_begin
(
&
state
,
locker
,
file
,
0
,
PSI_FILE_SYNC
,
src_file
,
src_line
);
src_line
);
#ifdef _WIN32
bool
success
=
os_file_flush_data_func
(
file
);
bool
result
=
os_file_flush_func
(
file
);
#else
bool
result
=
true
;
if
(
fdatasync
(
file
)
==
-
1
)
ib
::
error
()
<<
"fdatasync() errno: "
<<
errno
;
#endif
register_pfs_file_io_end
(
locker
,
0
);
register_pfs_file_io_end
(
locker
,
0
);
return
result
;
return
success
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment