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

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