autofs/SOURCES/autofs-5.1.4-use-defines-for-expire-type.patch

101 lines
3.1 KiB
Diff
Raw Normal View History

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