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

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