|
|
9a499a |
autofs-5.1.7 - cleanup cache_delete() a little
|
|
|
9a499a |
|
|
|
9a499a |
From: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
|
|
|
9a499a |
There's no reason to use local function storage for the passed in key
|
|
|
9a499a |
just use the given key.
|
|
|
9a499a |
|
|
|
9a499a |
Also, if there's no hash array entry for the key then there's no cache
|
|
|
9a499a |
entry so don't return a fail for this case.
|
|
|
9a499a |
|
|
|
9a499a |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
---
|
|
|
9a499a |
CHANGELOG | 1 +
|
|
|
9a499a |
lib/cache.c | 11 +++--------
|
|
|
9a499a |
2 files changed, 4 insertions(+), 8 deletions(-)
|
|
|
9a499a |
|
|
|
9a499a |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
9a499a |
+++ autofs-5.1.4/CHANGELOG
|
|
|
9a499a |
@@ -23,6 +23,7 @@
|
|
|
9a499a |
- eliminate some strlen calls in offset handling.
|
|
|
9a499a |
- don't add offset mounts to mounted mounts table.
|
|
|
9a499a |
- reduce umount EBUSY check delay.
|
|
|
9a499a |
+- cleanup cache_delete() a little.
|
|
|
9a499a |
|
|
|
9a499a |
xx/xx/2018 autofs-5.1.5
|
|
|
9a499a |
- fix flag file permission.
|
|
|
9a499a |
--- autofs-5.1.4.orig/lib/cache.c
|
|
|
9a499a |
+++ autofs-5.1.4/lib/cache.c
|
|
|
9a499a |
@@ -887,20 +887,15 @@ int cache_delete(struct mapent_cache *mc
|
|
|
9a499a |
struct mapent *me = NULL, *pred;
|
|
|
9a499a |
u_int32_t hashval = hash(key, mc->size);
|
|
|
9a499a |
int ret = CHE_OK;
|
|
|
9a499a |
- char this[PATH_MAX];
|
|
|
9a499a |
-
|
|
|
9a499a |
- strcpy(this, key);
|
|
|
9a499a |
|
|
|
9a499a |
me = mc->hash[hashval];
|
|
|
9a499a |
- if (!me) {
|
|
|
9a499a |
- ret = CHE_FAIL;
|
|
|
9a499a |
+ if (!me)
|
|
|
9a499a |
goto done;
|
|
|
9a499a |
- }
|
|
|
9a499a |
|
|
|
9a499a |
while (me->next != NULL) {
|
|
|
9a499a |
pred = me;
|
|
|
9a499a |
me = me->next;
|
|
|
9a499a |
- if (strcmp(this, me->key) == 0) {
|
|
|
9a499a |
+ if (strcmp(key, me->key) == 0) {
|
|
|
9a499a |
struct stack *s = me->stack;
|
|
|
9a499a |
if (me->multi && !list_empty(&me->multi_list)) {
|
|
|
9a499a |
ret = CHE_FAIL;
|
|
|
9a499a |
@@ -929,7 +924,7 @@ int cache_delete(struct mapent_cache *mc
|
|
|
9a499a |
if (!me)
|
|
|
9a499a |
goto done;
|
|
|
9a499a |
|
|
|
9a499a |
- if (strcmp(this, me->key) == 0) {
|
|
|
9a499a |
+ if (strcmp(key, me->key) == 0) {
|
|
|
9a499a |
struct stack *s = me->stack;
|
|
|
9a499a |
if (me->multi && !list_empty(&me->multi_list)) {
|
|
|
9a499a |
ret = CHE_FAIL;
|