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
f33908a8
Commit
f33908a8
authored
Nov 07, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ns: Rename "created" futex and comment what it is
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
ee2e8e5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
namespaces.h
include/namespaces.h
+9
-1
mount.c
mount.c
+3
-3
namespaces.c
namespaces.c
+1
-1
No files found.
include/namespaces.h
View file @
f33908a8
...
@@ -15,7 +15,15 @@ struct ns_id {
...
@@ -15,7 +15,15 @@ struct ns_id {
pid_t
pid
;
pid_t
pid
;
struct
ns_desc
*
nd
;
struct
ns_desc
*
nd
;
struct
ns_id
*
next
;
struct
ns_id
*
next
;
futex_t
created
;
/* boolean */
/*
* For mount namespaces on restore -- indicates that
* the namespace in question is created (all mounts
* are mounted) and other tasks may do setns on it
* and proceed.
*/
futex_t
ns_created
;
union
{
union
{
struct
{
struct
{
struct
mount_info
*
mntinfo_list
;
struct
mount_info
*
mntinfo_list
;
...
...
mount.c
View file @
f33908a8
...
@@ -1650,7 +1650,7 @@ static int rst_collect_local_mntns(void)
...
@@ -1650,7 +1650,7 @@ static int rst_collect_local_mntns(void)
if
(
!
mntinfo
)
if
(
!
mntinfo
)
return
-
1
;
return
-
1
;
futex_set
(
&
nsid
->
created
,
1
);
futex_set
(
&
nsid
->
ns_
created
,
1
);
return
0
;
return
0
;
}
}
...
@@ -1820,7 +1820,7 @@ static int do_restore_task_mnt_ns(struct ns_id *nsid)
...
@@ -1820,7 +1820,7 @@ static int do_restore_task_mnt_ns(struct ns_id *nsid)
if
(
nsid
->
pid
!=
getpid
())
{
if
(
nsid
->
pid
!=
getpid
())
{
int
fd
;
int
fd
;
futex_wait_while_eq
(
&
nsid
->
created
,
0
);
futex_wait_while_eq
(
&
nsid
->
ns_
created
,
0
);
fd
=
open_proc
(
nsid
->
pid
,
"ns/mnt"
);
fd
=
open_proc
(
nsid
->
pid
,
"ns/mnt"
);
if
(
fd
<
0
)
if
(
fd
<
0
)
return
-
1
;
return
-
1
;
...
@@ -1843,7 +1843,7 @@ static int do_restore_task_mnt_ns(struct ns_id *nsid)
...
@@ -1843,7 +1843,7 @@ static int do_restore_task_mnt_ns(struct ns_id *nsid)
if
(
cr_pivot_root
(
path
))
if
(
cr_pivot_root
(
path
))
return
-
1
;
return
-
1
;
futex_set_and_wake
(
&
nsid
->
created
,
1
);
futex_set_and_wake
(
&
nsid
->
ns_
created
,
1
);
return
0
;
return
0
;
}
}
...
...
namespaces.c
View file @
f33908a8
...
@@ -129,7 +129,7 @@ struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd)
...
@@ -129,7 +129,7 @@ struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd)
nsid
->
nd
=
nd
;
nsid
->
nd
=
nd
;
nsid
->
id
=
id
;
nsid
->
id
=
id
;
nsid
->
pid
=
pid
;
nsid
->
pid
=
pid
;
futex_set
(
&
nsid
->
created
,
0
);
futex_set
(
&
nsid
->
ns_
created
,
0
);
nsid
->
next
=
ns_ids
;
nsid
->
next
=
ns_ids
;
ns_ids
=
nsid
;
ns_ids
=
nsid
;
...
...
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