autofs/autofs-5.1.4-change-expire-type-naming-to-better-reflect-usage.patch

137 lines
4.0 KiB
Diff
Raw Normal View History

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(-)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -54,6 +54,7 @@ xx/xx/2018 autofs-5.1.5
- allow period following macro in selector value.
- fix macro expansion in selector values.
- also use strictexpire for offsets.
+- change expire type naming to better reflect usage.
19/12/2017 autofs-5.1.4
- fix spec file url.
--- autofs-5.1.4.orig/daemon/direct.c
+++ autofs-5.1.4/daemon/direct.c
@@ -861,7 +861,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;
@@ -872,7 +872,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;
@@ -966,7 +966,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);
@@ -992,7 +992,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);
--- autofs-5.1.4.orig/daemon/indirect.c
+++ autofs-5.1.4/daemon/indirect.c
@@ -402,7 +402,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;
@@ -415,7 +415,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;
@@ -540,7 +540,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);
@@ -554,7 +554,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++;
}
--- autofs-5.1.4.orig/daemon/state.c
+++ autofs-5.1.4/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 au
fatal(status);
ea->ap = ap;
- ea->when = now;
+ ea->how = how;
ea->status = 1;
if (ap->type == LKP_INDIRECT)
--- autofs-5.1.4.orig/include/state.h
+++ autofs-5.1.4/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 */
};