|
|
49b67f |
autofs-5.1.4 - use defines for expire type
|
|
|
49b67f |
|
|
|
49b67f |
From: Ian Kent <raven@themaw.net>
|
|
|
49b67f |
|
|
|
49b67f |
The kernel defines for expire type such as an immediate expire
|
|
|
49b67f |
shoule be used to clearify what is being requested.
|
|
|
49b67f |
|
|
|
49b67f |
AUTOFS_EXP_IMMEDIATE corresponds to a SIGUSR1 prune operation.
|
|
|
49b67f |
|
|
|
49b67f |
AUTOFS_EXP_FORCE corresponds to an expire type not yet implemented in
|
|
|
49b67f |
the kernel, a SIGUSR2 forced expire. Define it in our internal autofs
|
|
|
49b67f |
kernel include file, the kernel will ignore it if it doesn't support it.
|
|
|
49b67f |
|
|
|
49b67f |
AUTOFS_EXP_LEAVES is no longer used in autofs version 5.
|
|
|
49b67f |
|
|
|
49b67f |
Finally add a define AUTOFS_EXP_NORMAL to indicate we're perfoming a
|
|
|
49b67f |
normal expire.
|
|
|
49b67f |
|
|
|
49b67f |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
49b67f |
---
|
|
|
49b67f |
CHANGELOG | 1 +
|
|
|
49b67f |
daemon/state.c | 8 ++++----
|
|
|
49b67f |
include/linux/auto_fs4.h | 6 ++++--
|
|
|
49b67f |
include/state.h | 2 +-
|
|
|
49b67f |
4 files changed, 10 insertions(+), 7 deletions(-)
|
|
|
49b67f |
|
|
|
49b67f |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
49b67f |
+++ autofs-5.1.4/CHANGELOG
|
|
|
49b67f |
@@ -111,6 +111,7 @@ xx/xx/2018 autofs-5.1.5
|
|
|
49b67f |
- use a valid timeout in lookup_prune_one_cache().
|
|
|
49b67f |
- dont prune offset map entries.
|
|
|
49b67f |
- simplify sss source stale check.
|
|
|
49b67f |
+- use defines for expire type.
|
|
|
49b67f |
|
|
|
49b67f |
19/12/2017 autofs-5.1.4
|
|
|
49b67f |
- fix spec file url.
|
|
|
49b67f |
--- autofs-5.1.4.orig/daemon/state.c
|
|
|
49b67f |
+++ autofs-5.1.4/daemon/state.c
|
|
|
49b67f |
@@ -634,7 +634,7 @@ static unsigned int st_prepare_shutdown(
|
|
|
49b67f |
ap->state = ST_SHUTDOWN_PENDING;
|
|
|
49b67f |
|
|
|
49b67f |
/* Unmount everything */
|
|
|
49b67f |
- exp = expire_proc(ap, 1);
|
|
|
49b67f |
+ exp = expire_proc(ap, AUTOFS_EXP_IMMEDIATE);
|
|
|
49b67f |
switch (exp) {
|
|
|
49b67f |
case EXP_ERROR:
|
|
|
49b67f |
case EXP_PARTIAL:
|
|
|
49b67f |
@@ -660,7 +660,7 @@ static unsigned int st_force_shutdown(st
|
|
|
49b67f |
ap->state = ST_SHUTDOWN_FORCE;
|
|
|
49b67f |
|
|
|
49b67f |
/* Unmount everything */
|
|
|
49b67f |
- exp = expire_proc(ap, 1);
|
|
|
49b67f |
+ exp = expire_proc(ap, AUTOFS_EXP_FORCE | AUTOFS_EXP_IMMEDIATE);
|
|
|
49b67f |
switch (exp) {
|
|
|
49b67f |
case EXP_ERROR:
|
|
|
49b67f |
case EXP_PARTIAL:
|
|
|
49b67f |
@@ -695,7 +695,7 @@ static unsigned int st_prune(struct auto
|
|
|
49b67f |
assert(ap->state == ST_READY);
|
|
|
49b67f |
ap->state = ST_PRUNE;
|
|
|
49b67f |
|
|
|
49b67f |
- switch (expire_proc(ap, 1)) {
|
|
|
49b67f |
+ switch (expire_proc(ap, AUTOFS_EXP_IMMEDIATE)) {
|
|
|
49b67f |
case EXP_ERROR:
|
|
|
49b67f |
case EXP_PARTIAL:
|
|
|
49b67f |
if (!ap->submount)
|
|
|
49b67f |
@@ -716,7 +716,7 @@ static unsigned int st_expire(struct aut
|
|
|
49b67f |
assert(ap->state == ST_READY);
|
|
|
49b67f |
ap->state = ST_EXPIRE;
|
|
|
49b67f |
|
|
|
49b67f |
- switch (expire_proc(ap, 0)) {
|
|
|
49b67f |
+ switch (expire_proc(ap, AUTOFS_EXP_NORMAL)) {
|
|
|
49b67f |
case EXP_ERROR:
|
|
|
49b67f |
case EXP_PARTIAL:
|
|
|
49b67f |
if (!ap->submount)
|
|
|
49b67f |
--- autofs-5.1.4.orig/include/linux/auto_fs4.h
|
|
|
49b67f |
+++ autofs-5.1.4/include/linux/auto_fs4.h
|
|
|
49b67f |
@@ -27,8 +27,10 @@
|
|
|
49b67f |
#define AUTOFS_PROTO_SUBVERSION 2
|
|
|
49b67f |
|
|
|
49b67f |
/* Mask for expire behaviour */
|
|
|
49b67f |
-#define AUTOFS_EXP_IMMEDIATE 1
|
|
|
49b67f |
-#define AUTOFS_EXP_LEAVES 2
|
|
|
49b67f |
+#define AUTOFS_EXP_NORMAL 0x00
|
|
|
49b67f |
+#define AUTOFS_EXP_IMMEDIATE 0x01
|
|
|
49b67f |
+#define AUTOFS_EXP_LEAVES 0x02
|
|
|
49b67f |
+#define AUTOFS_EXP_FORCE 0x04
|
|
|
49b67f |
|
|
|
49b67f |
#define AUTOFS_TYPE_ANY 0U
|
|
|
49b67f |
#define AUTOFS_TYPE_INDIRECT 1U
|
|
|
49b67f |
--- autofs-5.1.4.orig/include/state.h
|
|
|
49b67f |
+++ autofs-5.1.4/include/state.h
|
|
|
49b67f |
@@ -55,7 +55,7 @@ struct expire_args {
|
|
|
49b67f |
unsigned int signaled;
|
|
|
49b67f |
struct autofs_point *ap; /* autofs mount we are working on */
|
|
|
49b67f |
enum states state; /* State prune or expire */
|
|
|
49b67f |
- unsigned int how; /* Normal, immediate expire ? */
|
|
|
49b67f |
+ unsigned int how; /* Normal, immediate, forced expire ? */
|
|
|
49b67f |
int status; /* Return status */
|
|
|
49b67f |
};
|
|
|
49b67f |
|