| 1667 | } |
| 1668 | |
| 1669 | void update_cache_info(void) |
| 1670 | { |
| 1671 | struct head_config * it_head_config = 0; |
| 1672 | struct head_cache *cache_h, *prev_h = NULL, *free_h; |
| 1673 | |
| 1674 | if (!dr_cache) |
| 1675 | return; |
| 1676 | |
| 1677 | /* now that we know the names of all partitions, cleanup old partitions */ |
| 1678 | cache_h = dr_cache; |
| 1679 | while (cache_h) { |
| 1680 | for (it_head_config = head_start; it_head_config != NULL; |
| 1681 | it_head_config = it_head_config->next) { |
| 1682 | if (cache_h->partition.len == it_head_config->partition.len && |
| 1683 | memcmp(cache_h->partition.s, it_head_config->partition.s, |
| 1684 | it_head_config->partition.len) == 0) |
| 1685 | break; |
| 1686 | } |
| 1687 | if (it_head_config != NULL) { |
| 1688 | prev_h = cache_h; |
| 1689 | cache_h = cache_h->next; |
| 1690 | continue; |
| 1691 | } |
| 1692 | LM_WARN("%.*s partition no longer used - cleaning old data!\n", |
| 1693 | cache_h->partition.len, cache_h->partition.s); |
| 1694 | |
| 1695 | |
| 1696 | if (!prev_h) { |
| 1697 | dr_cache = cache_h->next; |
| 1698 | rpm_key_set("drouting", dr_cache); |
| 1699 | } else { |
| 1700 | prev_h->next = cache_h->next; |
| 1701 | } |
| 1702 | free_h = cache_h; |
| 1703 | cache_h = cache_h->next; |
| 1704 | clean_head_cache(free_h); |
| 1705 | } |
| 1706 | } |
| 1707 | |
| 1708 | |
| 1709 | static int init_partition_status_report(struct head_db *part) |
no test coverage detected