autofs-5.1.6 - make umount_autofs() static From: Ian Kent The function umount_autofs() is only called within daemon/automount.c so make it static. Also it's only ever called with it's force parameter true so remove it as well and because this parameter is always true the failure case when calling umount_all() never happens. Signed-off-by: Ian Kent --- CHANGELOG | 1 + daemon/automount.c | 11 +++++------ include/automount.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 91420739..5531a579 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -58,6 +58,7 @@ xx/xx/2020 autofs-5.1.7 - add a hash index to mnt_list. - use mnt_list for submounts. - use mnt_list for amdmounts. +- make umount_autofs() static. 07/10/2019 autofs-5.1.6 - support strictexpire mount option. diff --git a/daemon/automount.c b/daemon/automount.c index d9644e4c..43640422 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -723,7 +723,7 @@ static int umount_all(struct autofs_point *ap, int force) return left; } -int umount_autofs(struct autofs_point *ap, const char *root, int force) +static int umount_autofs(struct autofs_point *ap, const char *root) { int ret = 0; @@ -738,8 +738,7 @@ int umount_autofs(struct autofs_point *ap, const char *root, int force) lookup_close_lookup(ap); if (ap->type == LKP_INDIRECT) { - if (umount_all(ap, force) && !force) - return -1; + umount_all(ap, 1); ret = umount_autofs_indirect(ap, root); } else ret = umount_autofs_direct(ap); @@ -1868,7 +1867,7 @@ int handle_mounts_exit(struct autofs_point *ap) * to check for possible recovery. */ if (ap->type == LKP_DIRECT) { - umount_autofs(ap, NULL, 1); + umount_autofs(ap, NULL); handle_mounts_cleanup(ap); return 1; } @@ -1879,7 +1878,7 @@ int handle_mounts_exit(struct autofs_point *ap) * so we can continue. This can happen if a lookup * occurs while we're trying to umount. */ - ret = umount_autofs(ap, NULL, 1); + ret = umount_autofs(ap, NULL); if (!ret) { set_indirect_mount_tree_catatonic(ap); handle_mounts_cleanup(ap); @@ -1935,7 +1934,7 @@ void *handle_mounts(void *arg) if (!(do_force_unlink & UNLINK_AND_EXIT)) crit(ap->logopt, "mount of %s failed!", ap->path); suc->status = 1; - umount_autofs(ap, root, 1); + umount_autofs(ap, root); free(root); pthread_setcancelstate(cancel_state, NULL); pthread_exit(NULL); diff --git a/include/automount.h b/include/automount.h index 600f98dd..e0c52077 100644 --- a/include/automount.h +++ b/include/automount.h @@ -600,7 +600,6 @@ int mount_autofs_direct(struct autofs_point *ap); int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, const char *root, const char *offset); void submount_signal_parent(struct autofs_point *ap, unsigned int success); void close_mount_fds(struct autofs_point *ap); -int umount_autofs(struct autofs_point *ap, const char *root, int force); int umount_autofs_indirect(struct autofs_point *ap, const char *root); int do_umount_autofs_direct(struct autofs_point *ap, struct mapent *me); int umount_autofs_direct(struct autofs_point *ap);