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
259374f6
Commit
259374f6
authored
Sep 18, 2015
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mnt: Add mi->mountpoint resolving helper
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d7696a42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
mount.c
mount.c
+26
-16
No files found.
mount.c
View file @
259374f6
...
@@ -2363,6 +2363,31 @@ static int rst_collect_local_mntns(void)
...
@@ -2363,6 +2363,31 @@ static int rst_collect_local_mntns(void)
return
0
;
return
0
;
}
}
static
int
get_mp_mountpoint
(
MntEntry
*
me
,
struct
mount_info
*
mi
,
char
*
root
,
int
root_len
)
{
int
len
;
len
=
strlen
(
me
->
mountpoint
)
+
root_len
+
1
;
mi
->
mountpoint
=
xmalloc
(
len
);
if
(
!
mi
->
mountpoint
)
return
-
1
;
/*
* For bind-mounts we would also fix the root here
* too, but bind-mounts restore merges mountpoint
* and root paths together, so there's no need in
* that.
*/
strcpy
(
mi
->
mountpoint
,
root
);
strcpy
(
mi
->
mountpoint
+
root_len
,
me
->
mountpoint
);
mi
->
ns_mountpoint
=
mi
->
mountpoint
+
root_len
;
pr_debug
(
"
\t\t
Will mount %d @ %s
\n
"
,
mi
->
mnt_id
,
mi
->
mountpoint
);
return
0
;
}
static
int
collect_mnt_from_image
(
struct
mount_info
**
pms
,
struct
ns_id
*
nsid
)
static
int
collect_mnt_from_image
(
struct
mount_info
**
pms
,
struct
ns_id
*
nsid
)
{
{
MntEntry
*
me
=
NULL
;
MntEntry
*
me
=
NULL
;
...
@@ -2381,7 +2406,6 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
...
@@ -2381,7 +2406,6 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
while
(
1
)
{
while
(
1
)
{
struct
mount_info
*
pm
;
struct
mount_info
*
pm
;
int
len
;
ret
=
pb_read_one_eof
(
img
,
&
me
,
PB_MNT
);
ret
=
pb_read_one_eof
(
img
,
&
me
,
PB_MNT
);
if
(
ret
<=
0
)
if
(
ret
<=
0
)
...
@@ -2477,22 +2501,8 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
...
@@ -2477,22 +2501,8 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
goto
err
;
goto
err
;
}
}
len
=
strlen
(
me
->
mountpoint
)
+
root_len
+
1
;
if
(
get_mp_mountpoint
(
me
,
pm
,
root
,
root_len
))
pm
->
mountpoint
=
xmalloc
(
len
);
if
(
!
pm
->
mountpoint
)
goto
err
;
goto
err
;
pm
->
ns_mountpoint
=
pm
->
mountpoint
+
root_len
;
/*
* For bind-mounts we would also fix the root here
* too, but bind-mounts restore merges mountpoint
* and root paths together, so there's no need in
* that.
*/
strcpy
(
pm
->
mountpoint
,
root
);
strcpy
(
pm
->
mountpoint
+
root_len
,
me
->
mountpoint
);
pr_debug
(
"
\t\t
Getting mpt for %d %s
\n
"
,
pm
->
mnt_id
,
pm
->
mountpoint
);
pr_debug
(
"
\t\t
Getting opts for %d
\n
"
,
pm
->
mnt_id
);
pr_debug
(
"
\t\t
Getting opts for %d
\n
"
,
pm
->
mnt_id
);
pm
->
options
=
xstrdup
(
me
->
options
);
pm
->
options
=
xstrdup
(
me
->
options
);
...
...
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