Blame SOURCES/autofs-5.1.8-simplify-cache_add-a-little.patch

f3080c
autofs-5.1.8 - simplify cache_add() a little
f3080c
f3080c
From: Ian Kent <raven@themaw.net>
f3080c
f3080c
If a map entry is being added to an existing hash chain there's an
f3080c
unneccessarily complicted setting of ->next of the last entry.
f3080c
f3080c
Just initialize the map entry ->next field instead and remove the
f3080c
confusing assignment.
f3080c
f3080c
Signed-off-by: Ian Kent <raven@themaw.net>
f3080c
---
f3080c
 CHANGELOG   |    1 +
f3080c
 lib/cache.c |    2 +-
f3080c
 2 files changed, 2 insertions(+), 1 deletion(-)
f3080c
f3080c
--- autofs-5.1.4.orig/CHANGELOG
f3080c
+++ autofs-5.1.4/CHANGELOG
f3080c
@@ -87,6 +87,7 @@
f3080c
 - fix nonstrict fail handling of last offset mount.
f3080c
 - dont fail on duplicate offset entry tree add.
f3080c
 - fix loop under run in cache_get_offset_parent().
f3080c
+- simplify cache_add() a little.
f3080c
 
f3080c
 xx/xx/2018 autofs-5.1.5
f3080c
 - fix flag file permission.
f3080c
--- autofs-5.1.4.orig/lib/cache.c
f3080c
+++ autofs-5.1.4/lib/cache.c
f3080c
@@ -564,6 +564,7 @@ int cache_add(struct mapent_cache *mc, s
f3080c
 	me->dev = (dev_t) -1;
f3080c
 	me->ino = (ino_t) -1;
f3080c
 	me->flags = 0;
f3080c
+	me->next = NULL;
f3080c
 
f3080c
 	/* 
f3080c
 	 * We need to add to the end if values exist in order to
f3080c
@@ -583,7 +584,6 @@ int cache_add(struct mapent_cache *mc, s
f3080c
 
f3080c
 			existing = next;
f3080c
 		}
f3080c
-		me->next = existing->next;
f3080c
 		existing->next = me;
f3080c
 	}
f3080c
 	return CHE_OK;