]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
mount: Drop unused pakfire_umount_all function
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 15:41:40 +0000 (15:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 15:41:40 +0000 (15:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/mount.h
src/libpakfire/jail.c
src/libpakfire/mount.c

index f47184a6b2a17ea5228ac90b2d59b519024ed452..fe9d3023fd1bb99a80037bce9623cab67774465e 100644 (file)
@@ -30,7 +30,6 @@ int pakfire_bind(struct pakfire* pakfire, const char* src, const char* dst, int
 int pakfire_mount_list(struct pakfire* pakfire);
 
 int pakfire_mount_all(struct pakfire* pakfire);
-int pakfire_umount_all(struct pakfire* pakfire);
 
 #endif /* PAKFIRE_PRIVATE */
 
index b954c185e947b5181eef799f3d5086ed65b9cb57..fafaa108ea5d2c184c399c1f2b4ad993a1f13fde 100644 (file)
@@ -1484,12 +1484,6 @@ ERROR:
        pakfire_jail_close_pipe(jail, ctx.pipes.log_ERROR);
        pakfire_jail_close_pipe(jail, ctx.pipes.log_DEBUG);
 
-#if 0
-       // Umount everything
-       if (!pakfire_on_root(jail->pakfire))
-               pakfire_umount_all(jail->pakfire);
-#endif
-
        return exit;
 }
 
index 8b602d19a830dca84a98f53da258ab2867360c6c..c2490589eace627e403178b7d38d6ff635862e31 100644 (file)
@@ -215,27 +215,6 @@ static int pakfire_mount(struct pakfire* pakfire, const char* source, const char
        return r;
 }
 
-static int pakfire_umount(struct pakfire* pakfire, const char* path, int flags) {
-       int r;
-
-       DEBUG(pakfire, "Umounting %s\n", path);
-
-RETRY:
-       // Perform umount
-       r = umount2(path, flags);
-       if (r) {
-               // Attempt a lazy umount when busy
-               if (errno == EBUSY) {
-                       flags |= MNT_DETACH;
-                       goto RETRY;
-               }
-
-               ERROR(pakfire, "Could not umount %s: %m\n", path);
-       }
-
-       return r;
-}
-
 static int __pakfire_mount_print(struct pakfire* pakfire,
                struct libmnt_fs* fs, const void* data) {
        DEBUG(pakfire,
@@ -403,23 +382,6 @@ RETRY:
        return 0;
 }
 
-static int __pakfire_umount(struct pakfire* pakfire,
-               struct libmnt_fs* fs, const void* data) {
-       const char* target = mnt_fs_get_target(fs);
-       if (!target)
-               return 1;
-
-       return pakfire_umount(pakfire, target, 0);
-}
-
-/*
-       umounts everything that hasn't been umounted, yet
-*/
-int pakfire_umount_all(struct pakfire* pakfire) {
-       return pakfire_mount_foreach(pakfire, MNT_ITER_BACKWARD,
-               __pakfire_umount, NULL);
-}
-
 PAKFIRE_EXPORT int pakfire_bind(struct pakfire* pakfire, const char* src, const char* dst, int flags) {
        struct stat st;
        char mountpoint[PATH_MAX];