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

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