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
fed36de0
Commit
fed36de0
authored
Mar 07, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dedup: Cleanup checking whether we batch punching or not
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
32a48b67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
cr-dedup.c
cr-dedup.c
+10
-3
No files found.
cr-dedup.c
View file @
fed36de0
...
...
@@ -103,15 +103,22 @@ exit:
return
0
;
}
static
inline
bool
can_extend_batch
(
struct
iovec
*
bunch
,
unsigned
long
off
,
unsigned
long
len
)
{
return
/* The next region is the continuation of the existing */
((
unsigned
long
)
bunch
->
iov_base
+
bunch
->
iov_len
==
off
)
&&
/* The resulting region is non empty and is small enough */
(
bunch
->
iov_len
==
0
||
bunch
->
iov_len
+
len
<
MAX_BUNCH_SIZE
*
PAGE_SIZE
);
}
int
punch_hole
(
struct
page_read
*
pr
,
unsigned
long
off
,
unsigned
long
len
,
bool
cleanup
)
{
int
ret
;
struct
iovec
*
bunch
=
&
pr
->
bunch
;
if
((
unsigned
long
)
bunch
->
iov_base
+
bunch
->
iov_len
==
off
&&
!
cleanup
&&
(
bunch
->
iov_len
+
len
<
MAX_BUNCH_SIZE
*
PAGE_SIZE
||
bunch
->
iov_len
==
0
))
{
if
(
!
cleanup
&&
can_extend_batch
(
bunch
,
off
,
len
))
{
pr_debug
(
"pr%d:Extend bunch len from %lx to %lx
\n
"
,
pr
->
id
,
bunch
->
iov_len
,
bunch
->
iov_len
+
len
);
bunch
->
iov_len
+=
len
;
...
...
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