[dovecot-cvs] dovecot/src/lib-index mail-index-open.c,1.26,1.27 mail-index.h,1.70,1.71
cras at procontrol.fi
cras at procontrol.fi
Thu Apr 10 00:10:03 EEST 2003
- Previous message: [dovecot-cvs] dovecot/src/lib-imap imap-envelope.c,1.25,1.26
- Next message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-uidlist.c,NONE,1.1 maildir-uidlist.h,NONE,1.1 Makefile.am,1.2,1.3 maildir-build.c,1.19,1.20 maildir-index.c,1.27,1.28 maildir-index.h,1.15,1.16 maildir-rebuild.c,1.9,1.10 maildir-sync.c,1.30,1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-index
In directory danu:/tmp/cvs-serv22327/lib-index
Modified Files:
mail-index-open.c mail-index.h
Log Message:
Rewritten maildir syncing. Uses dovecot-uidlist file to store UIDs
permanently.
Index: mail-index-open.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-open.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- mail-index-open.c 6 Mar 2003 19:23:44 -0000 1.26
+++ mail-index-open.c 9 Apr 2003 20:10:01 -0000 1.27
@@ -64,6 +64,8 @@
static int index_open_and_fix(struct mail_index *index,
enum mail_index_open_flags flags)
{
+ int rebuilt;
+
/* open/create the index files */
if ((flags & _MAIL_INDEX_OPEN_FLAG_CREATING) == 0) {
if (!mail_index_data_open(index)) {
@@ -97,6 +99,9 @@
/* no inconsistency problems since we're still opening
the index */
index->inconsistent = FALSE;
+ rebuilt = TRUE;
+ } else {
+ rebuilt = FALSE;
}
if ((flags & _MAIL_INDEX_OPEN_FLAG_CREATING) == 0) {
@@ -122,11 +127,14 @@
return FALSE;
}
- /* sync ourself. do it before updating cache and compression which
- may happen because of this. */
- if (!index->sync_and_lock(index, MAIL_LOCK_SHARED, NULL))
- return FALSE;
- index->inconsistent = FALSE;
+ if (!rebuilt) {
+ /* sync ourself. do it before updating cache and compression
+ which may happen because of this. */
+ if (!index->sync_and_lock(index, MAIL_LOCK_SHARED, NULL))
+ return FALSE;
+
+ index->inconsistent = FALSE;
+ }
/* we never want to keep shared lock if syncing happens to set it.
either exclusive or nothing (NOTE: drop it directly, not through
Index: mail-index.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- mail-index.h 6 Mar 2003 19:23:44 -0000 1.70
+++ mail-index.h 9 Apr 2003 20:10:01 -0000 1.71
@@ -393,6 +393,14 @@
dev_t mbox_dev;
ino_t mbox_ino;
+ /* last maildir sync: */
+ dev_t uidlist_dev;
+ ino_t uidlist_ino;
+ time_t uidlist_mtime;
+ off_t uidlist_size;
+
+ int maildir_lock_fd;
+
int fd; /* opened index file */
char *error; /* last error message */
@@ -416,6 +424,7 @@
unsigned int anon_mmap:1;
unsigned int opened:1;
+ unsigned int rebuilding:1;
unsigned int mail_read_mmaped:1;
unsigned int inconsistent:1;
unsigned int nodiskspace:1;
@@ -438,7 +447,8 @@
0, 0, 0, 0, 0, 0, { 0, 0, 0 }, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ 0
#endif
/* defaults - same as above but prefixed with mail_index_. */
- Previous message: [dovecot-cvs] dovecot/src/lib-imap imap-envelope.c,1.25,1.26
- Next message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-uidlist.c,NONE,1.1 maildir-uidlist.h,NONE,1.1 Makefile.am,1.2,1.3 maildir-build.c,1.19,1.20 maildir-index.c,1.27,1.28 maildir-index.h,1.15,1.16 maildir-rebuild.c,1.9,1.10 maildir-sync.c,1.30,1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list