dovecot-2.2: lib-index: Added minor version to dovecot.index.cac...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Nov 3 19:37:56 EET 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/8323e81785e2
changeset: 15373:8323e81785e2
user: Timo Sirainen <tss at iki.fi>
date: Sat Nov 03 19:37:47 2012 +0200
description:
lib-index: Added minor version to dovecot.index.cache file header.
diffstat:
src/doveadm/doveadm-dump-index.c | 3 ++-
src/lib-index/mail-cache-compress.c | 3 ++-
src/lib-index/mail-cache-private.h | 8 +++++---
src/lib-index/mail-cache.c | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
diffs (64 lines):
diff -r d2860e8fc774 -r 8323e81785e2 src/doveadm/doveadm-dump-index.c
--- a/src/doveadm/doveadm-dump-index.c Sat Nov 03 19:35:54 2012 +0200
+++ b/src/doveadm/doveadm-dump-index.c Sat Nov 03 19:37:47 2012 +0200
@@ -318,7 +318,8 @@
}
hdr = cache->hdr;
- printf("version .............. = %u\n", hdr->version);
+ printf("major version ........ = %u\n", hdr->major_version);
+ printf("minor version ........ = %u\n", hdr->minor_version);
printf("indexid .............. = %u (%s)\n", hdr->indexid, unixdate2str(hdr->indexid));
printf("file_seq ............. = %u (%s) (%d compressions)\n",
hdr->file_seq, unixdate2str(hdr->file_seq),
diff -r d2860e8fc774 -r 8323e81785e2 src/lib-index/mail-cache-compress.c
--- a/src/lib-index/mail-cache-compress.c Sat Nov 03 19:35:54 2012 +0200
+++ b/src/lib-index/mail-cache-compress.c Sat Nov 03 19:37:47 2012 +0200
@@ -171,7 +171,8 @@
output = o_stream_create_fd_file(fd, 0, FALSE);
memset(&hdr, 0, sizeof(hdr));
- hdr.version = MAIL_CACHE_VERSION;
+ hdr.major_version = MAIL_CACHE_MAJOR_VERSION;
+ hdr.minor_version = MAIL_CACHE_MINOR_VERSION;
hdr.compat_sizeof_uoff_t = sizeof(uoff_t);
hdr.indexid = cache->index->indexid;
hdr.file_seq = get_next_file_seq(cache, view);
diff -r d2860e8fc774 -r 8323e81785e2 src/lib-index/mail-cache-private.h
--- a/src/lib-index/mail-cache-private.h Sat Nov 03 19:35:54 2012 +0200
+++ b/src/lib-index/mail-cache-private.h Sat Nov 03 19:37:47 2012 +0200
@@ -5,7 +5,8 @@
#include "mail-index-private.h"
#include "mail-cache.h"
-#define MAIL_CACHE_VERSION 1
+#define MAIL_CACHE_MAJOR_VERSION 1
+#define MAIL_CACHE_MINOR_VERSION 1
/* Drop fields that haven't been accessed for n seconds */
#define MAIL_CACHE_FIELD_DROP_SECS (3600*24*30)
@@ -36,9 +37,10 @@
struct mail_cache_header {
/* version is increased only when you can't have backwards
compatibility. */
- uint8_t version;
+ uint8_t major_version;
uint8_t compat_sizeof_uoff_t;
- uint8_t unused[2];
+ uint8_t minor_version;
+ uint8_t unused;
uint32_t indexid;
uint32_t file_seq;
diff -r d2860e8fc774 -r 8323e81785e2 src/lib-index/mail-cache.c
--- a/src/lib-index/mail-cache.c Sat Nov 03 19:35:54 2012 +0200
+++ b/src/lib-index/mail-cache.c Sat Nov 03 19:37:47 2012 +0200
@@ -232,7 +232,7 @@
return FALSE;
}
- if (hdr->version != MAIL_CACHE_VERSION) {
+ if (hdr->major_version != MAIL_CACHE_MAJOR_VERSION) {
/* version changed - upgrade silently */
mail_cache_unlink(cache);
return FALSE;
More information about the dovecot-cvs
mailing list