Blame SOURCES/autofs-5.1.0-remove-unused-offset-handling-code.patch

304803
autofs-5.1.0 - remove unused offset handling code
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Some offset handling functions were moved into the cache module
304803
a while ago and are now unused.
304803
---
304803
 CHANGELOG        |    1 
304803
 include/mounts.h |    8 ----
304803
 lib/mounts.c     |   95 -------------------------------------------------------
304803
 3 files changed, 1 insertion(+), 103 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -167,6 +167,7 @@
304803
 - fix incorrect check in parse_mount().
304803
 - handle duplicates in multi mounts.
304803
 - fix macro usage in lookup_program.c.
304803
+- remove unused offset handling code.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/include/mounts.h
304803
+++ autofs-5.0.7/include/mounts.h
304803
@@ -68,11 +68,6 @@ struct mnt_list {
304803
 	struct list_head list;
304803
 	struct list_head entries;
304803
 	struct list_head sublist;
304803
-	/*
304803
-	 * Offset mount handling ie. add_ordered_list
304803
-	 * and get_offset.
304803
-	 */
304803
-	struct list_head ordered;
304803
 };
304803
 
304803
 
304803
@@ -109,9 +104,6 @@ void free_mnt_list(struct mnt_list *list
304803
 int contained_in_local_fs(const char *path);
304803
 int is_mounted(const char *table, const char *path, unsigned int type);
304803
 int has_fstab_option(const char *opt);
304803
-char *get_offset(const char *prefix, char *offset,
304803
-                 struct list_head *head, struct list_head **pos);
304803
-void add_ordered_list(struct mnt_list *ent, struct list_head *head);
304803
 void tree_free_mnt_tree(struct mnt_list *tree);
304803
 struct mnt_list *tree_make_mnt_tree(const char *table, const char *path);
304803
 int tree_get_mnt_list(struct mnt_list *mnts, struct list_head *list, const char *path, int include);
304803
--- autofs-5.0.7.orig/lib/mounts.c
304803
+++ autofs-5.0.7/lib/mounts.c
304803
@@ -1090,100 +1090,6 @@ int has_fstab_option(const char *opt)
304803
 	return ret;
304803
 }
304803
 
304803
-char *get_offset(const char *prefix, char *offset,
304803
-		 struct list_head *head, struct list_head **pos)
304803
-{
304803
-	struct list_head *next;
304803
-	struct mnt_list *this;
304803
-	size_t plen = strlen(prefix);
304803
-	size_t len = 0;
304803
-
304803
-	*offset = '\0';
304803
-	next = *pos ? (*pos)->next : head->next;
304803
-	while (next != head) {
304803
-		char *pstart, *pend;
304803
-
304803
-		this = list_entry(next, struct mnt_list, ordered);
304803
-		*pos = next;
304803
-		next = next->next;
304803
-
304803
-		if (strlen(this->path) <= plen)
304803
-			continue;
304803
-
304803
-		if (!strncmp(prefix, this->path, plen)) {
304803
-			pstart = &this->path[plen];
304803
-
304803
-			/* not part of this sub-tree */
304803
-			if (*pstart != '/')
304803
-				continue;
304803
-
304803
-			/* get next offset */
304803
-			pend = pstart;
304803
-			while (*pend++) ;
304803
-			len = pend - pstart - 1;
304803
-			strncpy(offset, pstart, len);
304803
-			offset[len] ='\0';
304803
-			break;
304803
-		}
304803
-	}
304803
-
304803
-	while (next != head) {
304803
-		char *pstart;
304803
-
304803
-		this = list_entry(next, struct mnt_list, ordered);
304803
-
304803
-		if (strlen(this->path) <= plen + len)
304803
-			break;
304803
-
304803
-		pstart = &this->path[plen];
304803
-
304803
-		/* not part of this sub-tree */
304803
-		if (*pstart != '/')
304803
-			break;
304803
-
304803
-		/* new offset */
304803
-		if (!*(pstart + len + 1))
304803
-			break;
304803
-
304803
-		/* compare next offset */
304803
-		if (pstart[len] != '/' || strncmp(offset, pstart, len))
304803
-			break;
304803
-
304803
-		*pos = next;
304803
-		next = next->next;
304803
-	}
304803
-
304803
-	return *offset ? offset : NULL;
304803
-}
304803
-
304803
-void add_ordered_list(struct mnt_list *ent, struct list_head *head)
304803
-{
304803
-	struct list_head *p;
304803
-	struct mnt_list *this;
304803
-
304803
-	list_for_each(p, head) {
304803
-		size_t tlen;
304803
-		int eq;
304803
-
304803
-		this = list_entry(p, struct mnt_list, ordered);
304803
-		tlen = strlen(this->path);
304803
-
304803
-		eq = strncmp(this->path, ent->path, tlen);
304803
-		if (!eq && tlen == strlen(ent->path))
304803
-			return;
304803
-
304803
-		if (eq > 0) {
304803
-			INIT_LIST_HEAD(&ent->ordered);
304803
-			list_add_tail(&ent->ordered, p);
304803
-			return;
304803
-		}
304803
-	}
304803
-	INIT_LIST_HEAD(&ent->ordered);
304803
-	list_add_tail(&ent->ordered, p);
304803
-
304803
-	return;
304803
-}
304803
-
304803
 /*
304803
  * Since we have to look at the entire mount tree for direct
304803
  * mounts (all mounts under "/") and we may have a large number
304803
@@ -1283,7 +1189,6 @@ struct mnt_list *tree_make_mnt_tree(cons
304803
 		INIT_LIST_HEAD(&ent->list);
304803
 		INIT_LIST_HEAD(&ent->entries);
304803
 		INIT_LIST_HEAD(&ent->sublist);
304803
-		INIT_LIST_HEAD(&ent->ordered);
304803
 
304803
 		ent->path = malloc(len + 1);
304803
 		if (!ent->path) {