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

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