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

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