Blame SOURCES/autofs-5.1.6-make-umount_autofs-static.patch

49b67f
autofs-5.1.6 - make umount_autofs() static
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
The function umount_autofs() is only called within daemon/automount.c
49b67f
so make it static.
49b67f
49b67f
Also it's only ever called with it's force parameter true so remove
49b67f
it as well and because this parameter is always true the failure case
49b67f
when calling umount_all() never happens.
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG           |    1 +
49b67f
 daemon/automount.c  |   11 +++++------
49b67f
 include/automount.h |    1 -
49b67f
 3 files changed, 6 insertions(+), 7 deletions(-)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -124,6 +124,7 @@ xx/xx/2018 autofs-5.1.5
49b67f
 - add a hash index to mnt_list.
49b67f
 - use mnt_list for submounts.
49b67f
 - use mnt_list for amdmounts.
49b67f
+- make umount_autofs() static.
49b67f
 
49b67f
 19/12/2017 autofs-5.1.4
49b67f
 - fix spec file url.
49b67f
--- autofs-5.1.4.orig/daemon/automount.c
49b67f
+++ autofs-5.1.4/daemon/automount.c
49b67f
@@ -722,7 +722,7 @@ static int umount_all(struct autofs_poin
49b67f
 	return left;
49b67f
 }
49b67f
 
49b67f
-int umount_autofs(struct autofs_point *ap, const char *root, int force)
49b67f
+static int umount_autofs(struct autofs_point *ap, const char *root)
49b67f
 {
49b67f
 	int ret = 0;
49b67f
 
49b67f
@@ -737,8 +737,7 @@ int umount_autofs(struct autofs_point *a
49b67f
 	lookup_close_lookup(ap);
49b67f
 
49b67f
 	if (ap->type == LKP_INDIRECT) {
49b67f
-		if (umount_all(ap, force) && !force)
49b67f
-			return -1;
49b67f
+		umount_all(ap, 1);
49b67f
 		ret = umount_autofs_indirect(ap, root);
49b67f
 	} else
49b67f
 		ret = umount_autofs_direct(ap);
49b67f
@@ -1867,7 +1866,7 @@ int handle_mounts_exit(struct autofs_poi
49b67f
 	 * to check for possible recovery.
49b67f
 	 */
49b67f
 	if (ap->type == LKP_DIRECT) {
49b67f
-		umount_autofs(ap, NULL, 1);
49b67f
+		umount_autofs(ap, NULL);
49b67f
 		handle_mounts_cleanup(ap);
49b67f
 		return 1;
49b67f
 	}
49b67f
@@ -1878,7 +1877,7 @@ int handle_mounts_exit(struct autofs_poi
49b67f
 	 * so we can continue. This can happen if a lookup
49b67f
 	 * occurs while we're trying to umount.
49b67f
 	 */
49b67f
-	ret = umount_autofs(ap, NULL, 1);
49b67f
+	ret = umount_autofs(ap, NULL);
49b67f
 	if (!ret) {
49b67f
 		set_indirect_mount_tree_catatonic(ap);
49b67f
 		handle_mounts_cleanup(ap);
49b67f
@@ -1934,7 +1933,7 @@ void *handle_mounts(void *arg)
49b67f
 		if (!(do_force_unlink & UNLINK_AND_EXIT))
49b67f
 			crit(ap->logopt, "mount of %s failed!", ap->path);
49b67f
 		suc->status = 1;
49b67f
-		umount_autofs(ap, root, 1);
49b67f
+		umount_autofs(ap, root);
49b67f
 		free(root);
49b67f
 		pthread_setcancelstate(cancel_state, NULL);
49b67f
 		pthread_exit(NULL);
49b67f
--- autofs-5.1.4.orig/include/automount.h
49b67f
+++ autofs-5.1.4/include/automount.h
49b67f
@@ -599,7 +599,6 @@ int mount_autofs_direct(struct autofs_po
49b67f
 int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, const char *root, const char *offset);
49b67f
 void submount_signal_parent(struct autofs_point *ap, unsigned int success);
49b67f
 void close_mount_fds(struct autofs_point *ap);
49b67f
-int umount_autofs(struct autofs_point *ap, const char *root, int force);
49b67f
 int umount_autofs_indirect(struct autofs_point *ap, const char *root);
49b67f
 int do_umount_autofs_direct(struct autofs_point *ap, struct mapent *me);
49b67f
 int umount_autofs_direct(struct autofs_point *ap);