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
b88272e3
Commit
b88272e3
authored
Feb 06, 2012
by
Julius Plenz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debugging code (use "cachestats" for that)
parent
0aa836ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
22 deletions
+1
-22
nocache.c
nocache.c
+1
-22
No files found.
nocache.c
View file @
b88272e3
...
...
@@ -106,29 +106,9 @@ static void store_pageinfo(int fd)
goto
cleanup
;
if
(
mincore
(
file
,
st
.
st_size
,
pageinfo
)
==
-
1
)
goto
cleanup
;
fds
[
i
].
info
=
pageinfo
;
#if DEBUG
fprintf
(
stderr
,
"cache stats: "
);
int
j
;
for
(
j
=
0
;
i
<
pages
;
i
++
)
{
fprintf
(
stderr
,
"%c"
,
(
pageinfo
[
j
]
&
1
)
?
'Y'
:
'N'
);
}
fprintf
(
stderr
,
"
\n
"
);
int
j
;
for
(
j
=
0
;
j
<
pages
;
j
++
)
if
(
!
(
pageinfo
[
j
]
&
1
))
break
;
if
(
j
==
pages
)
fprintf
(
stderr
,
"was fully in cache: %d: %d/%d
\n
"
,
fd
,
j
,
pages
);
else
fprintf
(
stderr
,
"was not fully in cache: %d: %d/%d
\n
"
,
fd
,
j
,
pages
);
#endif
munmap
(
file
,
st
.
st_size
);
return
;
cleanup:
...
...
@@ -142,6 +122,7 @@ static void store_pageinfo(int fd)
static
void
free_unclaimed_pages
(
int
fd
)
{
int
i
,
j
;
int
start
;
if
(
fd
==
-
1
)
return
;
...
...
@@ -154,7 +135,6 @@ static void free_unclaimed_pages(int fd)
sync_if_writable
(
fd
);
int
start
;
start
=
j
=
0
;
while
(
j
<
fds
[
i
].
nr_pages
)
{
if
(
fds
[
i
].
info
[
j
]
&
1
)
{
...
...
@@ -168,7 +148,6 @@ static void free_unclaimed_pages(int fd)
/* forget written contents that go beyond previous file size */
fadv_dontneed
(
fd
,
start
<
j
?
start
*
PAGESIZE
:
fds
[
i
].
size
,
0
);
if
(
fds
[
i
].
info
)
free
(
fds
[
i
].
info
);
fds
[
i
].
fd
=
-
1
;
}
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