]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
LAYOUT=index: Rename mailbox_list_index_node.corrupted_parent to corrupted_ext
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 13 Feb 2017 18:01:13 +0000 (20:01 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 13 Feb 2017 20:53:09 +0000 (22:53 +0200)
The code will be useful for other purposes also besides updating corrupted
parents.

src/lib-storage/list/mailbox-list-index-sync.c
src/lib-storage/list/mailbox-list-index.c
src/lib-storage/list/mailbox-list-index.h

index c30e242e7c7185c790d79b73ade4f2b160ca5372..52a24b300ecaab49d46722d1e3303b14e580b999 100644 (file)
@@ -376,17 +376,18 @@ mailbox_list_index_sync_update_corrupted_node(struct mailbox_list_index_sync_con
        if (!mail_index_lookup_seq(sync_ctx->view, node->uid, &seq))
                return;
 
-       if (node->corrupted_parent) {
+       if (node->corrupted_ext) {
                mail_index_lookup_ext(sync_ctx->view, seq,
                                      sync_ctx->ilist->ext_id,
                                      &data, &expunged);
                i_assert(data != NULL);
 
                memcpy(&irec, data, sizeof(irec));
+               irec.name_id = node->name_id;
                irec.parent_uid = node->parent == NULL ? 0 : node->parent->uid;
                mail_index_update_ext(sync_ctx->trans, seq,
                                      sync_ctx->ilist->ext_id, &irec, NULL);
-               node->corrupted_parent = FALSE;
+               node->corrupted_ext = FALSE;
        }
        if ((node->flags & MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME) != 0) {
                /* rely on lib-index to drop unnecessary updates */
index 6a006a2bf1f15e8f95683255ba2fae2e1daf5ae7..84e658f02da699bf4af6ae38d6c9d82980672009 100644 (file)
@@ -355,7 +355,7 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist,
                                if (ilist->has_backing_store)
                                        break;
                                /* just place it under the root */
-                               node->corrupted_parent = TRUE;
+                               node->corrupted_ext = TRUE;
                        } else if (node_has_parent(parent, node)) {
                                *error_r = t_strdup_printf(
                                        "parent_uid=%u loops to node itself (%s)",
@@ -363,7 +363,7 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist,
                                if (ilist->has_backing_store)
                                        break;
                                /* just place it under the root */
-                               node->corrupted_parent = TRUE;
+                               node->corrupted_ext = TRUE;
                        } else {
                                node->parent = parent;
                                node->next = parent->children;
index a46436b4c20644b8b5018edf16e23294e43ea1e0..1073a0d7deb356e96b67855728465fef40efca4d 100644 (file)
@@ -80,8 +80,8 @@ struct mailbox_list_index_node {
 
        uint32_t name_id, uid;
        enum mailbox_list_index_flags flags;
-       /* parent_uid is corrupted on disk - need to update it */
-       bool corrupted_parent;
+       /* extension data is corrupted on disk - need to update it */
+       bool corrupted_ext;
        const char *name;
 };