[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.8,
1.9
cras at procontrol.fi
cras at procontrol.fi
Mon May 24 04:50:19 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-lock.c, 1.16,
1.17 mail-index-sync-private.h, 1.6,
1.7 mail-index-sync-update.c, 1.16, 1.17 mail-index-sync.c,
1.16, 1.17 mail-index-transaction-private.h, 1.2,
1.3 mail-index-transaction.c, 1.6,
1.7 mail-index-view-private.h, 1.5, 1.6 mail-index-view-sync.c,
1.10, 1.11 mail-index.c, 1.123, 1.124 mail-index.h, 1.110,
1.111 mail-transaction-log-view.c, 1.11,
1.12 mail-transaction-log.c, 1.29, 1.30 mail-transaction-log.h,
1.9, 1.10 mail-transaction-util.c, 1.7,
1.8 mail-transaction-util.h, 1.3, 1.4
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-index-fsck.c, 1.20,
1.21 mail-index.c, 1.124, 1.125
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv13926/lib-storage/index/mbox
Modified Files:
mbox-sync.c
Log Message:
Index header changes now go through transaction log. Removed the kludgy
parameters for mail_index_sync_end(). Removed code duplication of syncing
index root mapping and view mapping. Some fixes to handling uidvalidity and
nextuid in syncing.
Index: mbox-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- a/mbox-sync.c 23 May 2004 01:58:32 -0000 1.8
+++ b/mbox-sync.c 24 May 2004 01:50:17 -0000 1.9
@@ -57,6 +57,7 @@
#include "mbox-lock.h"
#include "mbox-sync-private.h"
+#include <stddef.h>
#include <sys/stat.h>
static int mbox_sync_grow_file(struct mbox_sync_context *sync_ctx,
@@ -378,17 +379,6 @@
}
}
- if (ret < 0)
- mail_index_transaction_rollback(t);
- else {
- if (mail_index_transaction_commit(t, &seq, &offset) < 0)
- ret = -1;
- else if (seq != 0) {
- ibox->commit_log_file_seq = seq;
- ibox->commit_log_file_offset = offset;
- }
- }
-
if (ret == 0) {
if (fstat(ibox->mbox_fd, &st) < 0) {
mbox_set_syscall_error(ibox, "fstat()");
@@ -400,9 +390,36 @@
st.st_size = 0;
}
+ if (mail_index_get_header(sync_view, &hdr) < 0)
+ ret = -1;
+ if ((uint32_t)st.st_mtime != hdr->sync_stamp) {
+ uint32_t sync_stamp = st.st_mtime;
+
+ mail_index_update_header(t,
+ offsetof(struct mail_index_header, sync_stamp),
+ &sync_stamp, sizeof(sync_stamp));
+ }
+ if ((uint64_t)st.st_mtime != hdr->sync_size) {
+ uint64_t sync_size = st.st_size;
+
+ mail_index_update_header(t,
+ offsetof(struct mail_index_header, sync_size),
+ &sync_size, sizeof(sync_size));
+ }
+
+ if (ret < 0)
+ mail_index_transaction_rollback(t);
+ else {
+ if (mail_index_transaction_commit(t, &seq, &offset) < 0)
+ ret = -1;
+ else if (seq != 0) {
+ ibox->commit_log_file_seq = seq;
+ ibox->commit_log_file_offset = offset;
+ }
+ }
+
if (ret != -2) {
- if (mail_index_sync_end(index_sync_ctx,
- st.st_mtime, st.st_size) < 0)
+ if (mail_index_sync_end(index_sync_ctx) < 0)
ret = -1;
}
@@ -463,7 +480,7 @@
}
}
} else {
- (void)mail_index_sync_end(index_sync_ctx, 0, 0);
+ (void)mail_index_sync_end(index_sync_ctx);
ret = -1;
}
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-lock.c, 1.16,
1.17 mail-index-sync-private.h, 1.6,
1.7 mail-index-sync-update.c, 1.16, 1.17 mail-index-sync.c,
1.16, 1.17 mail-index-transaction-private.h, 1.2,
1.3 mail-index-transaction.c, 1.6,
1.7 mail-index-view-private.h, 1.5, 1.6 mail-index-view-sync.c,
1.10, 1.11 mail-index.c, 1.123, 1.124 mail-index.h, 1.110,
1.111 mail-transaction-log-view.c, 1.11,
1.12 mail-transaction-log.c, 1.29, 1.30 mail-transaction-log.h,
1.9, 1.10 mail-transaction-util.c, 1.7,
1.8 mail-transaction-util.h, 1.3, 1.4
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-index-fsck.c, 1.20,
1.21 mail-index.c, 1.124, 1.125
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list