dovecot: Added increasing file_seq field to list index.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Jul 19 02:56:45 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/e562c6359cd1
changeset: 6086:e562c6359cd1
user: Timo Sirainen <tss at iki.fi>
date: Thu Jul 19 01:55:14 2007 +0300
description:
Added increasing file_seq field to list index.
diffstat:
3 files changed, 6 insertions(+), 2 deletions(-)
src/lib-index/mailbox-list-index-private.h | 1 +
src/lib-index/mailbox-list-index-sync.c | 1 +
src/lib-index/mailbox-list-index.c | 6 ++++--
diffs (51 lines):
diff -r cc8b6e73e830 -r e562c6359cd1 src/lib-index/mailbox-list-index-private.h
--- a/src/lib-index/mailbox-list-index-private.h Thu Jul 19 00:29:35 2007 +0300
+++ b/src/lib-index/mailbox-list-index-private.h Thu Jul 19 01:55:14 2007 +0300
@@ -15,6 +15,7 @@ struct mailbox_list_index_header {
uint8_t minor_version;
uint8_t unused[2];
+ uint32_t file_seq;
uint32_t header_size;
uint32_t uid_validity;
diff -r cc8b6e73e830 -r e562c6359cd1 src/lib-index/mailbox-list-index-sync.c
--- a/src/lib-index/mailbox-list-index-sync.c Thu Jul 19 00:29:35 2007 +0300
+++ b/src/lib-index/mailbox-list-index-sync.c Thu Jul 19 01:55:14 2007 +0300
@@ -987,6 +987,7 @@ static int mailbox_list_index_compress(s
return -1;
/* reset header */
+ ctx->hdr.file_seq++;
ctx->hdr.used_space = sizeof(ctx->hdr);
ctx->hdr.deleted_space = 0;
diff -r cc8b6e73e830 -r e562c6359cd1 src/lib-index/mailbox-list-index.c
--- a/src/lib-index/mailbox-list-index.c Thu Jul 19 00:29:35 2007 +0300
+++ b/src/lib-index/mailbox-list-index.c Thu Jul 19 01:55:14 2007 +0300
@@ -197,13 +197,15 @@ static int mailbox_list_index_map_area(s
}
static void
-mailbox_list_index_init_header(struct mailbox_list_index_header *hdr,
+mailbox_list_index_init_header(struct mailbox_list_index *index,
+ struct mailbox_list_index_header *hdr,
uint32_t uid_validity)
{
memset(hdr, 0, sizeof(*hdr));
hdr->major_version = MAILBOX_LIST_INDEX_MAJOR_VERSION;
hdr->minor_version = MAILBOX_LIST_INDEX_MINOR_VERSION;
+ hdr->file_seq = index->hdr == NULL ? 1 : index->hdr->file_seq + 1;
hdr->header_size = sizeof(*hdr);
hdr->used_space = hdr->header_size;
@@ -262,7 +264,7 @@ int mailbox_list_index_file_create(struc
}
}
- mailbox_list_index_init_header(&hdr, uid_validity);
+ mailbox_list_index_init_header(index, &hdr, uid_validity);
if (write_full(fd, &hdr, sizeof(hdr)) < 0) {
mailbox_list_index_set_syscall_error(index, "write_full()");
(void)file_dotlock_delete(&dotlock);
More information about the dovecot-cvs
mailing list