Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
2449656e
Commit
2449656e
authored
Dec 30, 2015
by
Pavel Emelyanov
Committed by
Pavel Emelyanov
Jan 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Optimize vaddr_to_pfn
Signed-off-by:
Pavel Emelyanov
<
xemul@virtuozzo.com
>
parent
9c327c31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
util.c
util.c
+2
-7
No files found.
util.c
View file @
2449656e
...
@@ -768,12 +768,7 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
...
@@ -768,12 +768,7 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
return
errno
==
EPERM
?
1
:
-
1
;
return
errno
==
EPERM
?
1
:
-
1
;
off
=
(
vaddr
/
page_size
())
*
sizeof
(
u64
);
off
=
(
vaddr
/
page_size
())
*
sizeof
(
u64
);
if
(
lseek
(
fd
,
off
,
SEEK_SET
)
!=
off
)
{
ret
=
pread
(
fd
,
pfn
,
sizeof
(
*
pfn
),
off
);
pr_perror
(
"Failed to seek address %lx"
,
vaddr
);
goto
out
;
}
ret
=
read
(
fd
,
pfn
,
sizeof
(
*
pfn
));
if
(
ret
!=
sizeof
(
*
pfn
))
{
if
(
ret
!=
sizeof
(
*
pfn
))
{
pr_perror
(
"Can't read pme for pid %d"
,
getpid
());
pr_perror
(
"Can't read pme for pid %d"
,
getpid
());
ret
=
-
1
;
ret
=
-
1
;
...
@@ -781,7 +776,7 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
...
@@ -781,7 +776,7 @@ int vaddr_to_pfn(unsigned long vaddr, u64 *pfn)
*
pfn
&=
PME_PFRAME_MASK
;
*
pfn
&=
PME_PFRAME_MASK
;
ret
=
0
;
ret
=
0
;
}
}
out:
close
(
fd
);
close
(
fd
);
return
ret
;
return
ret
;
}
}
...
...
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