You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
4.3 KiB

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