Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
d45c0d96
Unverified
Commit
d45c0d96
authored
Mar 28, 2020
by
Christian Brauner
Committed by
Stéphane Graber
Mar 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: s/recursive_destroy/lxc_rm_rf/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
9b157781
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
cgfsng.c
src/lxc/cgroups/cgfsng.c
+5
-5
btrfs.c
src/lxc/storage/btrfs.c
+3
-3
lxc_ls.c
src/lxc/tools/lxc_ls.c
+1
-1
utils.c
src/lxc/utils.c
+2
-2
utils.h
src/lxc/utils.h
+1
-1
mount_injection.c
src/tests/mount_injection.c
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
d45c0d96
...
@@ -958,7 +958,7 @@ static int cgroup_tree_remove(struct hierarchy **hierarchies,
...
@@ -958,7 +958,7 @@ static int cgroup_tree_remove(struct hierarchy **hierarchies,
if
(
!
h
->
container_full_path
)
if
(
!
h
->
container_full_path
)
continue
;
continue
;
ret
=
recursive_destroy
(
h
->
container_full_path
);
ret
=
lxc_rm_rf
(
h
->
container_full_path
);
if
(
ret
<
0
)
if
(
ret
<
0
)
WARN
(
"Failed to destroy
\"
%s
\"
"
,
h
->
container_full_path
);
WARN
(
"Failed to destroy
\"
%s
\"
"
,
h
->
container_full_path
);
...
@@ -1085,7 +1085,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
...
@@ -1085,7 +1085,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
/* Monitor might have died before we entered the cgroup. */
/* Monitor might have died before we entered the cgroup. */
if
(
handler
->
monitor_pid
<=
0
)
{
if
(
handler
->
monitor_pid
<=
0
)
{
WARN
(
"No valid monitor process found while destroying cgroups"
);
WARN
(
"No valid monitor process found while destroying cgroups"
);
goto
try_
recursive_destroy
;
goto
try_
lxc_rm_rf
;
}
}
if
(
conf
&&
conf
->
cgroup_meta
.
dir
)
if
(
conf
&&
conf
->
cgroup_meta
.
dir
)
...
@@ -1101,7 +1101,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
...
@@ -1101,7 +1101,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
ret
=
mkdir_p
(
pivot_path
,
0755
);
ret
=
mkdir_p
(
pivot_path
,
0755
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
ERROR
(
"Failed to create %s"
,
pivot_path
);
ERROR
(
"Failed to create %s"
,
pivot_path
);
goto
try_
recursive_destroy
;
goto
try_
lxc_rm_rf
;
}
}
ret
=
lxc_write_openat
(
pivot_path
,
"cgroup.procs"
,
pidstr
,
len
);
ret
=
lxc_write_openat
(
pivot_path
,
"cgroup.procs"
,
pidstr
,
len
);
...
@@ -1110,8 +1110,8 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
...
@@ -1110,8 +1110,8 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
continue
;
continue
;
}
}
try_
recursive_destroy
:
try_
lxc_rm_rf
:
ret
=
recursive_destroy
(
h
->
monitor_full_path
);
ret
=
lxc_rm_rf
(
h
->
monitor_full_path
);
if
(
ret
<
0
)
if
(
ret
<
0
)
WARN
(
"Failed to destroy
\"
%s
\"
"
,
h
->
monitor_full_path
);
WARN
(
"Failed to destroy
\"
%s
\"
"
,
h
->
monitor_full_path
);
}
}
...
...
src/lxc/storage/btrfs.c
View file @
d45c0d96
...
@@ -730,7 +730,7 @@ static bool do_remove_btrfs_children(struct my_btrfs_tree *tree, u64 root_id,
...
@@ -730,7 +730,7 @@ static bool do_remove_btrfs_children(struct my_btrfs_tree *tree, u64 root_id,
return
true
;
return
true
;
}
}
static
int
btrfs_
recursive_destroy
(
const
char
*
path
)
static
int
btrfs_
lxc_rm_rf
(
const
char
*
path
)
{
{
u64
root_id
;
u64
root_id
;
int
fd
;
int
fd
;
...
@@ -893,7 +893,7 @@ bool btrfs_try_remove_subvol(const char *path)
...
@@ -893,7 +893,7 @@ bool btrfs_try_remove_subvol(const char *path)
if
(
!
btrfs_detect
(
path
))
if
(
!
btrfs_detect
(
path
))
return
false
;
return
false
;
return
btrfs_
recursive_destroy
(
path
)
==
0
;
return
btrfs_
lxc_rm_rf
(
path
)
==
0
;
}
}
int
btrfs_destroy
(
struct
lxc_storage
*
orig
)
int
btrfs_destroy
(
struct
lxc_storage
*
orig
)
...
@@ -902,7 +902,7 @@ int btrfs_destroy(struct lxc_storage *orig)
...
@@ -902,7 +902,7 @@ int btrfs_destroy(struct lxc_storage *orig)
src
=
lxc_storage_get_path
(
orig
->
src
,
"btrfs"
);
src
=
lxc_storage_get_path
(
orig
->
src
,
"btrfs"
);
return
btrfs_
recursive_destroy
(
src
);
return
btrfs_
lxc_rm_rf
(
src
);
}
}
int
btrfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
int
btrfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
...
...
src/lxc/tools/lxc_ls.c
View file @
d45c0d96
...
@@ -1071,7 +1071,7 @@ static int ls_remove_lock(const char *path, const char *name,
...
@@ -1071,7 +1071,7 @@ static int ls_remove_lock(const char *path, const char *name,
if
(
check
<
0
||
(
size_t
)
check
>=
*
len_lockpath
)
if
(
check
<
0
||
(
size_t
)
check
>=
*
len_lockpath
)
goto
out
;
goto
out
;
ret
=
recursive_destroy
(
*
lockpath
);
ret
=
lxc_rm_rf
(
*
lockpath
);
if
(
ret
<
0
)
if
(
ret
<
0
)
WARN
(
"Failed to destroy
\"
%s
\"
"
,
*
lockpath
);
WARN
(
"Failed to destroy
\"
%s
\"
"
,
*
lockpath
);
...
...
src/lxc/utils.c
View file @
d45c0d96
...
@@ -1747,7 +1747,7 @@ int fd_cloexec(int fd, bool cloexec)
...
@@ -1747,7 +1747,7 @@ int fd_cloexec(int fd, bool cloexec)
return
0
;
return
0
;
}
}
int
recursive_destroy
(
const
char
*
dirname
)
int
lxc_rm_rf
(
const
char
*
dirname
)
{
{
__do_closedir
DIR
*
dir
=
NULL
;
__do_closedir
DIR
*
dir
=
NULL
;
int
fret
=
0
;
int
fret
=
0
;
...
@@ -1779,7 +1779,7 @@ int recursive_destroy(const char *dirname)
...
@@ -1779,7 +1779,7 @@ int recursive_destroy(const char *dirname)
if
(
!
S_ISDIR
(
mystat
.
st_mode
))
if
(
!
S_ISDIR
(
mystat
.
st_mode
))
continue
;
continue
;
ret
=
recursive_destroy
(
pathname
);
ret
=
lxc_rm_rf
(
pathname
);
if
(
ret
<
0
)
if
(
ret
<
0
)
fret
=
-
1
;
fret
=
-
1
;
}
}
...
...
src/lxc/utils.h
View file @
d45c0d96
...
@@ -235,7 +235,7 @@ extern uint64_t lxc_find_next_power2(uint64_t n);
...
@@ -235,7 +235,7 @@ extern uint64_t lxc_find_next_power2(uint64_t n);
/* Set a signal the child process will receive after the parent has died. */
/* Set a signal the child process will receive after the parent has died. */
extern
int
lxc_set_death_signal
(
int
signal
,
pid_t
parent
,
int
parent_status_fd
);
extern
int
lxc_set_death_signal
(
int
signal
,
pid_t
parent
,
int
parent_status_fd
);
extern
int
fd_cloexec
(
int
fd
,
bool
cloexec
);
extern
int
fd_cloexec
(
int
fd
,
bool
cloexec
);
extern
int
recursive_destroy
(
const
char
*
dirname
);
extern
int
lxc_rm_rf
(
const
char
*
dirname
);
extern
int
lxc_setup_keyring
(
char
*
keyring_label
);
extern
int
lxc_setup_keyring
(
char
*
keyring_label
);
extern
bool
lxc_can_use_pidfd
(
int
pidfd
);
extern
bool
lxc_can_use_pidfd
(
int
pidfd
);
...
...
src/tests/mount_injection.c
View file @
d45c0d96
...
@@ -415,7 +415,7 @@ static bool lxc_setup_shmount(const char *shmount_path)
...
@@ -415,7 +415,7 @@ static bool lxc_setup_shmount(const char *shmount_path)
static
void
lxc_teardown_shmount
(
char
*
shmount_path
)
static
void
lxc_teardown_shmount
(
char
*
shmount_path
)
{
{
(
void
)
umount2
(
shmount_path
,
MNT_DETACH
);
(
void
)
umount2
(
shmount_path
,
MNT_DETACH
);
(
void
)
recursive_destroy
(
shmount_path
);
(
void
)
lxc_rm_rf
(
shmount_path
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
...
...
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