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
98fbeb8d
Commit
98fbeb8d
authored
Jan 31, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vma: Vma allocation helper is now function
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
593cb59a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
util.h
include/util.h
+0
-15
vma.h
include/vma.h
+1
-0
util.c
util.c
+18
-0
No files found.
include/util.h
View file @
98fbeb8d
...
@@ -118,21 +118,6 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
...
@@ -118,21 +118,6 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
} while (0)
} while (0)
#define pr_info_vma_list(head) pr_vma_list(LOG_INFO, head)
#define pr_info_vma_list(head) pr_vma_list(LOG_INFO, head)
/*
* Note since VMA_AREA_NONE = 0 we can skip assignment
* here and simply rely on xzalloc
*/
#define alloc_vma_area() \
({ \
struct vma_area *p__ = xzalloc(sizeof(*p__)); \
if (p__) { \
vma_entry__init(&p__->vma); \
p__->vm_file_fd = -1; \
p__->vma.fd = -1; \
} \
p__; \
})
extern
int
move_img_fd
(
int
*
img_fd
,
int
want_fd
);
extern
int
move_img_fd
(
int
*
img_fd
,
int
want_fd
);
extern
int
close_safe
(
int
*
fd
);
extern
int
close_safe
(
int
*
fd
);
...
...
include/vma.h
View file @
98fbeb8d
...
@@ -31,6 +31,7 @@ struct vma_area {
...
@@ -31,6 +31,7 @@ struct vma_area {
struct
stat
*
st
;
struct
stat
*
st
;
};
};
extern
struct
vma_area
*
alloc_vma_area
(
void
);
extern
int
collect_mappings
(
pid_t
pid
,
struct
vm_area_list
*
vma_area_list
);
extern
int
collect_mappings
(
pid_t
pid
,
struct
vm_area_list
*
vma_area_list
);
extern
void
free_mappings
(
struct
vm_area_list
*
vma_area_list
);
extern
void
free_mappings
(
struct
vm_area_list
*
vma_area_list
);
extern
bool
privately_dump_vma
(
struct
vma_area
*
vma
);
extern
bool
privately_dump_vma
(
struct
vma_area
*
vma
);
...
...
util.c
View file @
98fbeb8d
...
@@ -642,3 +642,21 @@ out:
...
@@ -642,3 +642,21 @@ out:
close
(
fd
);
close
(
fd
);
return
ret
;
return
ret
;
}
}
/*
* Note since VMA_AREA_NONE = 0 we can skip assignment
* here and simply rely on xzalloc
*/
struct
vma_area
*
alloc_vma_area
(
void
)
{
struct
vma_area
*
p
;
p
=
xzalloc
(
sizeof
(
*
p
));
if
(
p
)
{
vma_entry__init
(
&
p
->
vma
);
p
->
vm_file_fd
=
-
1
;
p
->
vma
.
fd
=
-
1
;
}
return
p
;
}
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