Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nocache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Danil Mikhailov
nocache
Commits
8c589dd5
Commit
8c589dd5
authored
Feb 06, 2012
by
Julius Plenz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move advice NOREUSE to store_pageinfo()
parent
b947ea15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
nocache.c
nocache.c
+4
-3
No files found.
nocache.c
View file @
8c589dd5
...
...
@@ -77,7 +77,6 @@ int open(const char *pathname, int flags, mode_t mode)
int
fd
;
if
((
fd
=
_original_open
(
pathname
,
flags
,
mode
))
!=
-
1
)
{
store_pageinfo
(
fd
);
fadv_noreuse
(
fd
,
0
,
0
);
}
return
fd
;
}
...
...
@@ -87,7 +86,6 @@ int creat(const char *pathname, int flags, mode_t mode)
int
fd
;
if
((
fd
=
_original_creat
(
pathname
,
flags
,
mode
))
!=
-
1
)
{
store_pageinfo
(
fd
);
fadv_noreuse
(
fd
,
0
,
0
);
}
return
fd
;
}
...
...
@@ -97,7 +95,6 @@ int openat(int dirfd, const char *pathname, int flags, mode_t mode)
int
fd
;
if
((
fd
=
_original_openat
(
dirfd
,
pathname
,
flags
,
mode
))
!=
-
1
)
{
store_pageinfo
(
fd
);
fadv_noreuse
(
fd
,
0
,
0
);
}
return
fd
;
}
...
...
@@ -121,6 +118,10 @@ static void store_pageinfo(int fd)
if
(
!
S_ISREG
(
st
.
st_mode
))
return
;
/* Hint we'll be using this file only once;
* the Linux kernel will currently ignore this */
fadv_noreuse
(
fd
,
0
,
0
);
/* check if there's space to store the info */
pthread_mutex_lock
(
&
lock
);
for
(
i
=
0
;
i
<
_MAX_FDS
&&
fds
[
i
].
fd
!=
-
1
;
i
++
)
...
...
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