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