]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tree-wide: s/recursive_destroy/lxc_rm_rf/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 28 Mar 2020 14:03:51 +0000 (15:03 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 28 Mar 2020 14:06:55 +0000 (15:06 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/storage/btrfs.c
src/lxc/tools/lxc_ls.c
src/lxc/utils.c
src/lxc/utils.h
src/tests/mount_injection.c

index 11b6fd3c9b1f172ae3f8faeee3877aeabef6225b..5c37c842e0feaf18dfb24af14dfe48b483d67c6c 100644 (file)
@@ -958,7 +958,7 @@ static int cgroup_tree_remove(struct hierarchy **hierarchies,
                if (!h->container_full_path)
                        continue;
 
-               ret = recursive_destroy(h->container_full_path);
+               ret = lxc_rm_rf(h->container_full_path);
                if (ret < 0)
                        WARN("Failed to destroy \"%s\"", h->container_full_path);
 
@@ -1085,7 +1085,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
                /* Monitor might have died before we entered the cgroup. */
                if (handler->monitor_pid <= 0) {
                        WARN("No valid monitor process found while destroying cgroups");
-                       goto try_recursive_destroy;
+                       goto try_lxc_rm_rf;
                }
 
                if (conf && conf->cgroup_meta.dir)
@@ -1101,7 +1101,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
                ret = mkdir_p(pivot_path, 0755);
                if (ret < 0 && errno != EEXIST) {
                        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);
@@ -1110,8 +1110,8 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
                        continue;
                }
 
-try_recursive_destroy:
-               ret = recursive_destroy(h->monitor_full_path);
+try_lxc_rm_rf:
+               ret = lxc_rm_rf(h->monitor_full_path);
                if (ret < 0)
                        WARN("Failed to destroy \"%s\"", h->monitor_full_path);
        }
index 092930519749b6f0008ee956c076fdb1a3600428..92a4a6def22297e33096a73520fcb7f7bf6670e2 100644 (file)
@@ -730,7 +730,7 @@ static bool do_remove_btrfs_children(struct my_btrfs_tree *tree, u64 root_id,
        return true;
 }
 
-static int btrfs_recursive_destroy(const char *path)
+static int btrfs_lxc_rm_rf(const char *path)
 {
        u64 root_id;
        int fd;
@@ -893,7 +893,7 @@ bool btrfs_try_remove_subvol(const char *path)
        if (!btrfs_detect(path))
                return false;
 
-       return btrfs_recursive_destroy(path) == 0;
+       return btrfs_lxc_rm_rf(path) == 0;
 }
 
 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");
 
-       return btrfs_recursive_destroy(src);
+       return btrfs_lxc_rm_rf(src);
 }
 
 int btrfs_create(struct lxc_storage *bdev, const char *dest, const char *n,
index 7a0ae6269880978e72a286c573e01fe585375446..4be8564d19115c6102948f0ff11d0add490d811a 100644 (file)
@@ -1071,7 +1071,7 @@ static int ls_remove_lock(const char *path, const char *name,
        if (check < 0 || (size_t)check >= *len_lockpath)
                goto out;
 
-       ret = recursive_destroy(*lockpath);
+       ret = lxc_rm_rf(*lockpath);
        if (ret < 0)
                WARN("Failed to destroy \"%s\"", *lockpath);
 
index c34519084db466b921aee6851a65191cafec244c..97507fe6421fad30c6ed00bfa5593f7ffc3ed290 100644 (file)
@@ -1747,7 +1747,7 @@ int fd_cloexec(int fd, bool cloexec)
        return 0;
 }
 
-int recursive_destroy(const char *dirname)
+int lxc_rm_rf(const char *dirname)
 {
        __do_closedir DIR *dir = NULL;
        int fret = 0;
@@ -1779,7 +1779,7 @@ int recursive_destroy(const char *dirname)
                if (!S_ISDIR(mystat.st_mode))
                        continue;
 
-               ret = recursive_destroy(pathname);
+               ret = lxc_rm_rf(pathname);
                if (ret < 0)
                        fret = -1;
        }
index 1d980f8855b44806df9e5f8cf277affb855c2125..4ab41bf1f4e6c9926fba545b4e4f1c05e5b9d54c 100644 (file)
@@ -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. */
 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 recursive_destroy(const char *dirname);
+extern int lxc_rm_rf(const char *dirname);
 extern int lxc_setup_keyring(char *keyring_label);
 extern bool lxc_can_use_pidfd(int pidfd);
 
index 3ea15f43317ee54a1bb5f6b1a14d9b573b9ebec2..3c44d4014f11c1d40c9315cc75501630e5253233 100644 (file)
@@ -415,7 +415,7 @@ static bool lxc_setup_shmount(const char *shmount_path)
 static void lxc_teardown_shmount(char *shmount_path)
 {
        (void)umount2(shmount_path, MNT_DETACH);
-       (void)recursive_destroy(shmount_path);
+       (void)lxc_rm_rf(shmount_path);
 }
 
 int main(int argc, char *argv[])