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
4598242d
Commit
4598242d
authored
Feb 03, 2012
by
Julius Plenz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename function for clarity
parent
5a2943bd
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 @
4598242d
...
@@ -14,8 +14,9 @@ int (*_original_close)(int fd);
...
@@ -14,8 +14,9 @@ int (*_original_close)(int fd);
void
init
(
void
)
__attribute__
((
constructor
));
void
init
(
void
)
__attribute__
((
constructor
));
int
open
(
const
char
*
pathname
,
int
flags
,
mode_t
mode
);
int
open
(
const
char
*
pathname
,
int
flags
,
mode_t
mode
);
int
close
(
int
fd
);
int
close
(
int
fd
);
static
void
store_pageinfo
(
int
fd
);
static
void
store_pageinfo
(
int
fd
);
static
void
free_pages
(
int
fd
);
static
void
free_
unclaimed_
pages
(
int
fd
);
extern
int
fadv_dontneed
(
int
fd
,
off_t
offset
,
off_t
len
);
extern
int
fadv_dontneed
(
int
fd
,
off_t
offset
,
off_t
len
);
#define _MAX_FDS 1024
#define _MAX_FDS 1024
...
@@ -46,7 +47,7 @@ int open(const char *pathname, int flags, mode_t mode)
...
@@ -46,7 +47,7 @@ int open(const char *pathname, int flags, mode_t mode)
int
close
(
int
fd
)
int
close
(
int
fd
)
{
{
free_pages
(
fd
);
free_
unclaimed_
pages
(
fd
);
return
_original_close
(
fd
);
return
_original_close
(
fd
);
}
}
...
@@ -93,7 +94,7 @@ static void store_pageinfo(int fd)
...
@@ -93,7 +94,7 @@ static void store_pageinfo(int fd)
munmap
(
file
,
st
.
st_size
);
munmap
(
file
,
st
.
st_size
);
}
}
static
void
free_pages
(
int
fd
)
static
void
free_
unclaimed_
pages
(
int
fd
)
{
{
int
i
,
j
;
int
i
,
j
;
...
...
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