Ian Kent f53fbf
autofs-5.1.4 - change expire type naming to better reflect usage
Ian Kent f53fbf
Ian Kent f53fbf
From: Ian Kent <raven@themaw.net>
Ian Kent f53fbf
Ian Kent f53fbf
Expires can request different types of expire, currently normal or
Ian Kent f53fbf
immediate (and later force).
Ian Kent f53fbf
Ian Kent f53fbf
Change the naming used in the expire functions to better indicate
Ian Kent f53fbf
usage.
Ian Kent f53fbf
Ian Kent f53fbf
Signed-off-by: Ian Kent <raven@themaw.net>
Ian Kent f53fbf
---
Ian Kent f53fbf
 CHANGELOG         |    1 +
Ian Kent f53fbf
 daemon/direct.c   |    8 ++++----
Ian Kent f53fbf
 daemon/indirect.c |    8 ++++----
Ian Kent f53fbf
 daemon/state.c    |    4 ++--
Ian Kent f53fbf
 include/state.h   |    2 +-
Ian Kent f53fbf
 5 files changed, 12 insertions(+), 11 deletions(-)
Ian Kent f53fbf
Ian Kent f53fbf
--- autofs-5.1.4.orig/CHANGELOG
Ian Kent f53fbf
+++ autofs-5.1.4/CHANGELOG
Ian Kent f53fbf
@@ -26,6 +26,7 @@ xx/xx/2018 autofs-5.1.5
Ian Kent f53fbf
 - fix NFS version mask usage.
Ian Kent f53fbf
 - fix fd leak in rpc_do_create_client().
Ian Kent f53fbf
 - add-man page note about extra slashes in paths.
Ian Kent f53fbf
+- change expire type naming to better reflect usage.
Ian Kent f53fbf
 
Ian Kent f53fbf
 19/12/2017 autofs-5.1.4
Ian Kent f53fbf
 - fix spec file url.
Ian Kent f53fbf
--- autofs-5.1.4.orig/daemon/direct.c
Ian Kent f53fbf
+++ autofs-5.1.4/daemon/direct.c
Ian Kent f53fbf
@@ -841,7 +841,7 @@ void *expire_proc_direct(void *arg)
Ian Kent f53fbf
 	struct expire_args ec;
Ian Kent f53fbf
 	struct autofs_point *ap;
Ian Kent f53fbf
 	struct mapent *me = NULL;
Ian Kent f53fbf
-	unsigned int now;
Ian Kent f53fbf
+	unsigned int how;
Ian Kent f53fbf
 	int ioctlfd, cur_state;
Ian Kent f53fbf
 	int status, ret, left;
Ian Kent f53fbf
 
Ian Kent f53fbf
@@ -852,7 +852,7 @@ void *expire_proc_direct(void *arg)
Ian Kent f53fbf
 		fatal(status);
Ian Kent f53fbf
 
Ian Kent f53fbf
 	ap = ec.ap = ea->ap;
Ian Kent f53fbf
-	now = ea->when;
Ian Kent f53fbf
+	how = ea->how;
Ian Kent f53fbf
 	ec.status = -1;
Ian Kent f53fbf
 
Ian Kent f53fbf
 	ea->signaled = 1;
Ian Kent f53fbf
@@ -946,7 +946,7 @@ void *expire_proc_direct(void *arg)
Ian Kent f53fbf
 
Ian Kent f53fbf
 			ioctlfd = me->ioctlfd;
Ian Kent f53fbf
 
Ian Kent f53fbf
-			ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
Ian Kent f53fbf
+			ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
Ian Kent f53fbf
 			if (ret) {
Ian Kent f53fbf
 				left++;
Ian Kent f53fbf
 				pthread_setcancelstate(cur_state, NULL);
Ian Kent f53fbf
@@ -972,7 +972,7 @@ void *expire_proc_direct(void *arg)
Ian Kent f53fbf
 		debug(ap->logopt, "send expire to trigger %s", next->path);
Ian Kent f53fbf
 
Ian Kent f53fbf
 		pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
Ian Kent f53fbf
-		ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
Ian Kent f53fbf
+		ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
Ian Kent f53fbf
 		if (ret)
Ian Kent f53fbf
 			left++;
Ian Kent f53fbf
 		pthread_setcancelstate(cur_state, NULL);
Ian Kent f53fbf
--- autofs-5.1.4.orig/daemon/indirect.c
Ian Kent f53fbf
+++ autofs-5.1.4/daemon/indirect.c
Ian Kent f53fbf
@@ -392,7 +392,7 @@ void *expire_proc_indirect(void *arg)
Ian Kent f53fbf
 	struct mnt_list *mnts = NULL, *next;
Ian Kent f53fbf
 	struct expire_args *ea;
Ian Kent f53fbf
 	struct expire_args ec;
Ian Kent f53fbf
-	unsigned int now;
Ian Kent f53fbf
+	unsigned int how;
Ian Kent f53fbf
 	int offsets, submnts, count;
Ian Kent f53fbf
 	int retries;
Ian Kent f53fbf
 	int ioctlfd, cur_state;
Ian Kent f53fbf
@@ -405,7 +405,7 @@ void *expire_proc_indirect(void *arg)
Ian Kent f53fbf
 		fatal(status);
Ian Kent f53fbf
 
Ian Kent f53fbf
 	ap = ec.ap = ea->ap;
Ian Kent f53fbf
-	now = ea->when;
Ian Kent f53fbf
+	how = ea->how;
Ian Kent f53fbf
 	ec.status = -1;
Ian Kent f53fbf
 
Ian Kent f53fbf
 	ea->signaled = 1;
Ian Kent f53fbf
@@ -530,7 +530,7 @@ void *expire_proc_indirect(void *arg)
Ian Kent f53fbf
 		debug(ap->logopt, "expire %s", next->path);
Ian Kent f53fbf
 
Ian Kent f53fbf
 		pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
Ian Kent f53fbf
-		ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
Ian Kent f53fbf
+		ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
Ian Kent f53fbf
 		if (ret)
Ian Kent f53fbf
 			left++;
Ian Kent f53fbf
 		pthread_setcancelstate(cur_state, NULL);
Ian Kent f53fbf
@@ -544,7 +544,7 @@ void *expire_proc_indirect(void *arg)
Ian Kent f53fbf
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
Ian Kent f53fbf
 	retries = (count_mounts(ap, ap->path, ap->dev) + 1);
Ian Kent f53fbf
 	while (retries--) {
Ian Kent f53fbf
-		ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, now);
Ian Kent f53fbf
+		ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, how);
Ian Kent f53fbf
 		if (ret)
Ian Kent f53fbf
 			left++;
Ian Kent f53fbf
 	}
Ian Kent f53fbf
--- autofs-5.1.4.orig/daemon/state.c
Ian Kent f53fbf
+++ autofs-5.1.4/daemon/state.c
Ian Kent f53fbf
@@ -267,7 +267,7 @@ void expire_proc_cleanup(void *arg)
Ian Kent f53fbf
 	return;
Ian Kent f53fbf
 }
Ian Kent f53fbf
 
Ian Kent f53fbf
-static enum expire expire_proc(struct autofs_point *ap, int now)
Ian Kent f53fbf
+static enum expire expire_proc(struct autofs_point *ap, int how)
Ian Kent f53fbf
 {
Ian Kent f53fbf
 	pthread_t thid;
Ian Kent f53fbf
 	struct expire_args *ea;
Ian Kent f53fbf
@@ -295,7 +295,7 @@ static enum expire expire_proc(struct au
Ian Kent f53fbf
 		fatal(status);
Ian Kent f53fbf
 
Ian Kent f53fbf
 	ea->ap = ap;
Ian Kent f53fbf
-	ea->when = now;
Ian Kent f53fbf
+	ea->how = how;
Ian Kent f53fbf
 	ea->status = 1;
Ian Kent f53fbf
 
Ian Kent f53fbf
 	if (ap->type == LKP_INDIRECT)
Ian Kent f53fbf
--- autofs-5.1.4.orig/include/state.h
Ian Kent f53fbf
+++ autofs-5.1.4/include/state.h
Ian Kent f53fbf
@@ -55,7 +55,7 @@ struct expire_args {
Ian Kent f53fbf
 	unsigned int signaled;
Ian Kent f53fbf
 	struct autofs_point *ap; /* autofs mount we are working on */
Ian Kent f53fbf
 	enum states state;	 /* State prune or expire */
Ian Kent f53fbf
-	unsigned int when;	 /* Immediate expire ? */
Ian Kent f53fbf
+	unsigned int how;	 /* Normal, immediate expire ? */
Ian Kent f53fbf
 	int status;		 /* Return status */
Ian Kent f53fbf
 };
Ian Kent f53fbf