|
|
8fa62f |
autofs-5.1.4 - change expire type naming to better reflect usage
|
|
|
8fa62f |
|
|
|
8fa62f |
From: Ian Kent <raven@themaw.net>
|
|
|
8fa62f |
|
|
|
8fa62f |
Expires can request different types of expire, currently normal or
|
|
|
8fa62f |
immediate (and later force).
|
|
|
8fa62f |
|
|
|
8fa62f |
Change the naming used in the expire functions to better indicate
|
|
|
8fa62f |
usage.
|
|
|
8fa62f |
|
|
|
8fa62f |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
8fa62f |
---
|
|
|
8fa62f |
CHANGELOG | 1 +
|
|
|
8fa62f |
daemon/direct.c | 8 ++++----
|
|
|
8fa62f |
daemon/indirect.c | 8 ++++----
|
|
|
8fa62f |
daemon/state.c | 4 ++--
|
|
|
8fa62f |
include/state.h | 2 +-
|
|
|
8fa62f |
5 files changed, 12 insertions(+), 11 deletions(-)
|
|
|
8fa62f |
|
|
|
8fa62f |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
8fa62f |
+++ autofs-5.1.4/CHANGELOG
|
|
|
8fa62f |
@@ -54,6 +54,7 @@ xx/xx/2018 autofs-5.1.5
|
|
|
8fa62f |
- allow period following macro in selector value.
|
|
|
8fa62f |
- fix macro expansion in selector values.
|
|
|
8fa62f |
- also use strictexpire for offsets.
|
|
|
8fa62f |
+- change expire type naming to better reflect usage.
|
|
|
8fa62f |
|
|
|
8fa62f |
19/12/2017 autofs-5.1.4
|
|
|
8fa62f |
- fix spec file url.
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/direct.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/direct.c
|
|
|
8fa62f |
@@ -861,7 +861,7 @@ void *expire_proc_direct(void *arg)
|
|
|
8fa62f |
struct expire_args ec;
|
|
|
8fa62f |
struct autofs_point *ap;
|
|
|
8fa62f |
struct mapent *me = NULL;
|
|
|
8fa62f |
- unsigned int now;
|
|
|
8fa62f |
+ unsigned int how;
|
|
|
8fa62f |
int ioctlfd, cur_state;
|
|
|
8fa62f |
int status, ret, left;
|
|
|
8fa62f |
|
|
|
8fa62f |
@@ -872,7 +872,7 @@ void *expire_proc_direct(void *arg)
|
|
|
8fa62f |
fatal(status);
|
|
|
8fa62f |
|
|
|
8fa62f |
ap = ec.ap = ea->ap;
|
|
|
8fa62f |
- now = ea->when;
|
|
|
8fa62f |
+ how = ea->how;
|
|
|
8fa62f |
ec.status = -1;
|
|
|
8fa62f |
|
|
|
8fa62f |
ea->signaled = 1;
|
|
|
8fa62f |
@@ -966,7 +966,7 @@ void *expire_proc_direct(void *arg)
|
|
|
8fa62f |
|
|
|
8fa62f |
ioctlfd = me->ioctlfd;
|
|
|
8fa62f |
|
|
|
8fa62f |
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
|
|
|
8fa62f |
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
|
|
|
8fa62f |
if (ret) {
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
pthread_setcancelstate(cur_state, NULL);
|
|
|
8fa62f |
@@ -992,7 +992,7 @@ void *expire_proc_direct(void *arg)
|
|
|
8fa62f |
debug(ap->logopt, "send expire to trigger %s", next->path);
|
|
|
8fa62f |
|
|
|
8fa62f |
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
|
|
|
8fa62f |
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
|
|
|
8fa62f |
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
|
|
|
8fa62f |
if (ret)
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
pthread_setcancelstate(cur_state, NULL);
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/indirect.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/indirect.c
|
|
|
8fa62f |
@@ -402,7 +402,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
struct mnt_list *mnts = NULL, *next;
|
|
|
8fa62f |
struct expire_args *ea;
|
|
|
8fa62f |
struct expire_args ec;
|
|
|
8fa62f |
- unsigned int now;
|
|
|
8fa62f |
+ unsigned int how;
|
|
|
8fa62f |
int offsets, submnts, count;
|
|
|
8fa62f |
int retries;
|
|
|
8fa62f |
int ioctlfd, cur_state;
|
|
|
8fa62f |
@@ -415,7 +415,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
fatal(status);
|
|
|
8fa62f |
|
|
|
8fa62f |
ap = ec.ap = ea->ap;
|
|
|
8fa62f |
- now = ea->when;
|
|
|
8fa62f |
+ how = ea->how;
|
|
|
8fa62f |
ec.status = -1;
|
|
|
8fa62f |
|
|
|
8fa62f |
ea->signaled = 1;
|
|
|
8fa62f |
@@ -540,7 +540,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
debug(ap->logopt, "expire %s", next->path);
|
|
|
8fa62f |
|
|
|
8fa62f |
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
|
|
|
8fa62f |
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
|
|
|
8fa62f |
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
|
|
|
8fa62f |
if (ret)
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
pthread_setcancelstate(cur_state, NULL);
|
|
|
8fa62f |
@@ -554,7 +554,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
|
|
|
8fa62f |
retries = (count_mounts(ap, ap->path, ap->dev) + 1);
|
|
|
8fa62f |
while (retries--) {
|
|
|
8fa62f |
- ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, now);
|
|
|
8fa62f |
+ ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, how);
|
|
|
8fa62f |
if (ret)
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/state.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/state.c
|
|
|
8fa62f |
@@ -267,7 +267,7 @@ void expire_proc_cleanup(void *arg)
|
|
|
8fa62f |
return;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
-static enum expire expire_proc(struct autofs_point *ap, int now)
|
|
|
8fa62f |
+static enum expire expire_proc(struct autofs_point *ap, int how)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
pthread_t thid;
|
|
|
8fa62f |
struct expire_args *ea;
|
|
|
8fa62f |
@@ -295,7 +295,7 @@ static enum expire expire_proc(struct au
|
|
|
8fa62f |
fatal(status);
|
|
|
8fa62f |
|
|
|
8fa62f |
ea->ap = ap;
|
|
|
8fa62f |
- ea->when = now;
|
|
|
8fa62f |
+ ea->how = how;
|
|
|
8fa62f |
ea->status = 1;
|
|
|
8fa62f |
|
|
|
8fa62f |
if (ap->type == LKP_INDIRECT)
|
|
|
8fa62f |
--- autofs-5.1.4.orig/include/state.h
|
|
|
8fa62f |
+++ autofs-5.1.4/include/state.h
|
|
|
8fa62f |
@@ -55,7 +55,7 @@ struct expire_args {
|
|
|
8fa62f |
unsigned int signaled;
|
|
|
8fa62f |
struct autofs_point *ap; /* autofs mount we are working on */
|
|
|
8fa62f |
enum states state; /* State prune or expire */
|
|
|
8fa62f |
- unsigned int when; /* Immediate expire ? */
|
|
|
8fa62f |
+ unsigned int how; /* Normal, immediate expire ? */
|
|
|
8fa62f |
int status; /* Return status */
|
|
|
8fa62f |
};
|
|
|
8fa62f |
|