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
2d2dc613
Commit
2d2dc613
authored
Dec 16, 2009
by
vasil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/innodb+: Portability fix
Use POSIX_FADV* and posix_fadvise() only if they are available.
parent
c5f5f7a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
row/row0merge.c
row/row0merge.c
+6
-0
No files found.
row/row0merge.c
View file @
2d2dc613
...
...
@@ -709,8 +709,10 @@ row_merge_read(
(
ulint
)
(
ofs
&
0xFFFFFFFF
),
(
ulint
)
(
ofs
>>
32
),
sizeof
*
buf
);
#ifdef POSIX_FADV_DONTNEED
/* Each block is read exactly once. Free up the file cache. */
posix_fadvise
(
fd
,
ofs
,
sizeof
*
buf
,
POSIX_FADV_DONTNEED
);
#endif
/* POSIX_FADV_DONTNEED */
if
(
UNIV_UNLIKELY
(
!
success
))
{
ut_print_timestamp
(
stderr
);
...
...
@@ -742,9 +744,11 @@ row_merge_write(
}
#endif
/* UNIV_DEBUG */
#ifdef POSIX_FADV_DONTNEED
/* The block will be needed on the next merge pass,
but it can be evicted from the file cache meanwhile. */
posix_fadvise
(
fd
,
ofs
,
sizeof
*
buf
,
POSIX_FADV_DONTNEED
);
#endif
/* POSIX_FADV_DONTNEED */
return
(
UNIV_LIKELY
(
os_file_write
(
"(merge)"
,
OS_FILE_FROM_FD
(
fd
),
buf
,
(
ulint
)
(
ofs
&
0xFFFFFFFF
),
...
...
@@ -1594,11 +1598,13 @@ row_merge(
of
.
offset
=
0
;
of
.
n_rec
=
0
;
#ifdef POSIX_FADV_SEQUENTIAL
/* The input file will be read sequentially, starting from the
beginning and the middle. In Linux, the POSIX_FADV_SEQUENTIAL
affects the entire file. Each block will be read exactly once. */
posix_fadvise
(
file
->
fd
,
0
,
0
,
POSIX_FADV_SEQUENTIAL
|
POSIX_FADV_NOREUSE
);
#endif
/* POSIX_FADV_SEQUENTIAL */
/* Merge blocks to the output file. */
ohalf
=
0
;
...
...
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