annotate src/lib-index/mail-transaction-log-private.h @ 11634:7f19062f58fd HEAD

Renamed fsync_disable to mail_fsync=optimized|always|never.
author Timo Sirainen <tss@iki.fi>
date Fri, 25 Jun 2010 16:21:49 +0100
parents 22354f505277
children 2dca300aee5c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6360
diff changeset
1 #ifndef MAIL_TRANSACTION_LOG_VIEW_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6360
diff changeset
2 #define MAIL_TRANSACTION_LOG_VIEW_H
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
9623
3da42dafa798 buffer_create_[const_]data() API change: Take buffer_t as parameter instead of allocating it.
Timo Sirainen <tss@iki.fi>
parents: 9311
diff changeset
4 #include "buffer.h"
1920
d11efbf1d341 Added fcntl_lock_disable setting to allow indexes to work with NFS. Some
Timo Sirainen <tss@iki.fi>
parents: 1915
diff changeset
5 #include "file-dotlock.h"
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 #include "mail-transaction-log.h"
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7
6360
461ae76c84da Replaced MAIL_INDEX_LOCK_SECS usage with cache/index/log specific defines
Timo Sirainen <tss@iki.fi>
parents: 5881
diff changeset
8 /* Synchronization can take a while sometimes, especially when copying lots of
461ae76c84da Replaced MAIL_INDEX_LOCK_SECS usage with cache/index/log specific defines
Timo Sirainen <tss@iki.fi>
parents: 5881
diff changeset
9 mails. */
461ae76c84da Replaced MAIL_INDEX_LOCK_SECS usage with cache/index/log specific defines
Timo Sirainen <tss@iki.fi>
parents: 5881
diff changeset
10 #define MAIL_TRANSCATION_LOG_LOCK_TIMEOUT (3*60)
461ae76c84da Replaced MAIL_INDEX_LOCK_SECS usage with cache/index/log specific defines
Timo Sirainen <tss@iki.fi>
parents: 5881
diff changeset
11 #define MAIL_TRANSCATION_LOG_LOCK_CHANGE_TIMEOUT (3*60)
461ae76c84da Replaced MAIL_INDEX_LOCK_SECS usage with cache/index/log specific defines
Timo Sirainen <tss@iki.fi>
parents: 5881
diff changeset
12
5283
8f9af66ee313 If transaction log grows larger than 1MB, rotate it even if it was created
Timo Sirainen <tss@iki.fi>
parents: 4876
diff changeset
13 /* Rotate when log is older than ROTATE_TIME and larger than MIN_SIZE */
5813
9b4987348cf6 Removed debug #defines and changed log rotation size defaults.
Timo Sirainen <tss@iki.fi>
parents: 5749
diff changeset
14 #define MAIL_TRANSACTION_LOG_ROTATE_MIN_SIZE (1024*32)
5283
8f9af66ee313 If transaction log grows larger than 1MB, rotate it even if it was created
Timo Sirainen <tss@iki.fi>
parents: 4876
diff changeset
15 /* If log is larger than MAX_SIZE, rotate regardless of the time */
8f9af66ee313 If transaction log grows larger than 1MB, rotate it even if it was created
Timo Sirainen <tss@iki.fi>
parents: 4876
diff changeset
16 #define MAIL_TRANSACTION_LOG_ROTATE_MAX_SIZE (1024*1024)
3180
ef16bb8091aa Several transaction log cleanups and fixes.
Timo Sirainen <tss@iki.fi>
parents: 3146
diff changeset
17 #define MAIL_TRANSACTION_LOG_ROTATE_TIME (60*5)
ef16bb8091aa Several transaction log cleanups and fixes.
Timo Sirainen <tss@iki.fi>
parents: 3146
diff changeset
18
5881
7b7ce27f2b13 Delete over 30 minutes old .log.2 files when opening indexes.
Timo Sirainen <tss@iki.fi>
parents: 5849
diff changeset
19 /* Delete .log.2 files older than this many seconds */
7b7ce27f2b13 Delete over 30 minutes old .log.2 files when opening indexes.
Timo Sirainen <tss@iki.fi>
parents: 5849
diff changeset
20 #define MAIL_TRANSACTION_LOG2_STALE_SECS (60*30)
7b7ce27f2b13 Delete over 30 minutes old .log.2 files when opening indexes.
Timo Sirainen <tss@iki.fi>
parents: 5849
diff changeset
21
3243
40b4ba3c55b8 In-memory indexes work again. Just pass dir as NULL to mail_index_alloc().
Timo Sirainen <tss@iki.fi>
parents: 3180
diff changeset
22 #define MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file) ((file)->fd == -1)
40b4ba3c55b8 In-memory indexes work again. Just pass dir as NULL to mail_index_alloc().
Timo Sirainen <tss@iki.fi>
parents: 3180
diff changeset
23
7812
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
24 #define LOG_FILE_MODSEQ_CACHE_SIZE 10
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
25
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
26 struct modseq_cache {
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
27 uoff_t offset;
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
28 uint64_t highest_modseq;
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
29 };
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
30
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31 struct mail_transaction_log_file {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 struct mail_transaction_log *log;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33 struct mail_transaction_log_file *next;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34
4828
7cc1b8fec8ab Reference counting fixes. Fixes an assert crash when closing the index.
Timo Sirainen <tss@iki.fi>
parents: 4785
diff changeset
35 /* refcount=0 is a valid state. files start that way, and they're
7cc1b8fec8ab Reference counting fixes. Fixes an assert crash when closing the index.
Timo Sirainen <tss@iki.fi>
parents: 4785
diff changeset
36 freed only when mail_transaction_logs_clean() is called. */
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 int refcount;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
39 char *filepath;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40 int fd;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
41
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
42 ino_t st_ino;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
43 dev_t st_dev;
1976
4e0269adb24a Don't rotate transaction log too often
Timo Sirainen <tss@iki.fi>
parents: 1974
diff changeset
44 time_t last_mtime;
3320
0403596c93fd index.log file is now rotated to .index.log.2 file. When log file is
Timo Sirainen <tss@iki.fi>
parents: 3243
diff changeset
45 uoff_t last_size;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
46
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
47 struct mail_transaction_log_header hdr;
9623
3da42dafa798 buffer_create_[const_]data() API change: Take buffer_t as parameter instead of allocating it.
Timo Sirainen <tss@iki.fi>
parents: 9311
diff changeset
48 buffer_t mmap_buffer;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
49 buffer_t *buffer;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
50 uoff_t buffer_offset;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
51 void *mmap_base;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
52 size_t mmap_size;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
53
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
54 /* points to the next uncommitted transaction. usually same as EOF. */
2407
fed6d07bd8ee Transaction log file is now read-lockless.
Timo Sirainen <tss@iki.fi>
parents: 1976
diff changeset
55 uoff_t sync_offset;
7812
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
56 /* highest modseq at sync_offset */
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
57 uint64_t sync_highest_modseq;
5749
420a386fa27a int/ext/mailbox sync offset changes: Combined mailbox and int offsets to
Timo Sirainen <tss@iki.fi>
parents: 5716
diff changeset
58 /* saved_tail_offset is the offset that was last written to transaction
420a386fa27a int/ext/mailbox sync offset changes: Combined mailbox and int offsets to
Timo Sirainen <tss@iki.fi>
parents: 5716
diff changeset
59 log. max_tail_offset is what should be written to the log the next
420a386fa27a int/ext/mailbox sync offset changes: Combined mailbox and int offsets to
Timo Sirainen <tss@iki.fi>
parents: 5716
diff changeset
60 time a transaction is written. transaction log handling may update
420a386fa27a int/ext/mailbox sync offset changes: Combined mailbox and int offsets to
Timo Sirainen <tss@iki.fi>
parents: 5716
diff changeset
61 max_tail_offset automatically by making it skip external transactions
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
62 after the last saved offset (to avoid re-reading them unneededly). */
5749
420a386fa27a int/ext/mailbox sync offset changes: Combined mailbox and int offsets to
Timo Sirainen <tss@iki.fi>
parents: 5716
diff changeset
63 uoff_t saved_tail_offset, max_tail_offset;
8136
285f636884dc Don't give bogus "log_file_tail_offset shrank" errors.
Timo Sirainen <tss@iki.fi>
parents: 7931
diff changeset
64 /* don't give warnings about saved_tail_offset shrinking if
285f636884dc Don't give bogus "log_file_tail_offset shrank" errors.
Timo Sirainen <tss@iki.fi>
parents: 7931
diff changeset
65 sync_offset is less than this. */
285f636884dc Don't give bogus "log_file_tail_offset shrank" errors.
Timo Sirainen <tss@iki.fi>
parents: 7931
diff changeset
66 uoff_t saved_tail_sync_offset;
2407
fed6d07bd8ee Transaction log file is now read-lockless.
Timo Sirainen <tss@iki.fi>
parents: 1976
diff changeset
67
10674
22354f505277 lib-index: Added support for undeleting a deleted index.
Timo Sirainen <tss@iki.fi>
parents: 10655
diff changeset
68 /* if we've seen _INDEX_[UN9DELETED transaction in this file,
22354f505277 lib-index: Added support for undeleting a deleted index.
Timo Sirainen <tss@iki.fi>
parents: 10655
diff changeset
69 this is the offset. otherwise (uoff_t)-1 */
22354f505277 lib-index: Added support for undeleting a deleted index.
Timo Sirainen <tss@iki.fi>
parents: 10655
diff changeset
70 uoff_t index_deleted_offset, index_undeleted_offset;
10655
fc0ac73f0b36 Added support for marking mailbox index deleted. Don't allow any changes after that.
Timo Sirainen <tss@iki.fi>
parents: 9697
diff changeset
71
7812
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
72 struct modseq_cache modseq_cache[LOG_FILE_MODSEQ_CACHE_SIZE];
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
73
4876
f1d77064884c Lock handling changes. Everything goes through file-lock API now and there's
Timo Sirainen <tss@iki.fi>
parents: 4828
diff changeset
74 struct file_lock *file_lock;
f1d77064884c Lock handling changes. Everything goes through file-lock API now and there's
Timo Sirainen <tss@iki.fi>
parents: 4828
diff changeset
75
2407
fed6d07bd8ee Transaction log file is now read-lockless.
Timo Sirainen <tss@iki.fi>
parents: 1976
diff changeset
76 unsigned int locked:1;
5819
4ea31bf18a56 Handle indexid changes better.
Timo Sirainen <tss@iki.fi>
parents: 5813
diff changeset
77 unsigned int corrupted:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
78 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
79
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 struct mail_transaction_log {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
81 struct mail_index *index;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
82 struct mail_transaction_log_view *views;
9697
6e4b79ca75cc index: Code cleanups.
Timo Sirainen <tss@iki.fi>
parents: 9696
diff changeset
83 char *filepath, *filepath2;
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
84
4785
a18fa2b4bf06 Code cleanup
Timo Sirainen <tss@iki.fi>
parents: 4777
diff changeset
85 /* files is a linked list of all the opened log files. the list is
a18fa2b4bf06 Code cleanup
Timo Sirainen <tss@iki.fi>
parents: 4777
diff changeset
86 sorted by the log file sequence, so that transaction views can use
a18fa2b4bf06 Code cleanup
Timo Sirainen <tss@iki.fi>
parents: 4777
diff changeset
87 them easily. head contains a pointer to the newest log file. */
a18fa2b4bf06 Code cleanup
Timo Sirainen <tss@iki.fi>
parents: 4777
diff changeset
88 struct mail_transaction_log_file *files, *head;
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
89 /* open_file is used temporarily while opening the log file.
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
90 if _open() failed, it's left there for _create(). */
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
91 struct mail_transaction_log_file *open_file;
1974
d85f71ffeb8f file_dotlock_open/delete/replace now has lock_suffix parameter. NULL
Timo Sirainen <tss@iki.fi>
parents: 1933
diff changeset
92
d85f71ffeb8f file_dotlock_open/delete/replace now has lock_suffix parameter. NULL
Timo Sirainen <tss@iki.fi>
parents: 1933
diff changeset
93 unsigned int dotlock_count;
3106
9c4aa309dbac Changed dotlocking API.
Timo Sirainen <tss@iki.fi>
parents: 2407
diff changeset
94 struct dotlock_settings dotlock_settings, new_dotlock_settings;
9c4aa309dbac Changed dotlocking API.
Timo Sirainen <tss@iki.fi>
parents: 2407
diff changeset
95 struct dotlock *dotlock;
11634
7f19062f58fd Renamed fsync_disable to mail_fsync=optimized|always|never.
Timo Sirainen <tss@iki.fi>
parents: 10674
diff changeset
96
7f19062f58fd Renamed fsync_disable to mail_fsync=optimized|always|never.
Timo Sirainen <tss@iki.fi>
parents: 10674
diff changeset
97 unsigned int nfs_flush:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
98 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
99
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
100 void
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
101 mail_transaction_log_file_set_corrupted(struct mail_transaction_log_file *file,
3342
43d4aad84752 Minor error checking fixes.
Timo Sirainen <tss@iki.fi>
parents: 3320
diff changeset
102 const char *fmt, ...)
6411
6a64e64fa3a3 Renamed __attr_*__ to ATTR_*. Renamed __attrs_used__ to ATTRS_DEFINED.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
103 ATTR_FORMAT(2, 3);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
104
5687
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
105 struct mail_transaction_log_file *
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
106 mail_transaction_log_file_alloc_in_memory(struct mail_transaction_log *log);
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
107 struct mail_transaction_log_file *
5687
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
108 mail_transaction_log_file_alloc(struct mail_transaction_log *log,
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
109 const char *path);
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
110 void mail_transaction_log_file_free(struct mail_transaction_log_file **file);
5687
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
111
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
112 int mail_transaction_log_file_open(struct mail_transaction_log_file *file,
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
113 bool check_existing);
5849
a9df50952600 Added support for resetting index.
Timo Sirainen <tss@iki.fi>
parents: 5819
diff changeset
114 int mail_transaction_log_file_create(struct mail_transaction_log_file *file,
a9df50952600 Added support for resetting index.
Timo Sirainen <tss@iki.fi>
parents: 5819
diff changeset
115 bool reset);
5687
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
116 int mail_transaction_log_file_lock(struct mail_transaction_log_file *file);
d28185a3131a Moved mail transaction log file related code to its own file.
Timo Sirainen <tss@iki.fi>
parents: 5283
diff changeset
117
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
118 int mail_transaction_log_find_file(struct mail_transaction_log *log,
6802
ba58eaf06763 Keep better track of when we need to flush NFS attribute caches.
Timo Sirainen <tss@iki.fi>
parents: 6411
diff changeset
119 uint32_t file_seq, bool nfs_flush,
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
120 struct mail_transaction_log_file **file_r);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
121
5716
4a08705e97f5 Fixes to mail_transaction_log_file_map() error handling.
Timo Sirainen <tss@iki.fi>
parents: 5714
diff changeset
122 /* Returns 1 if ok, 0 if file is corrupted or offset range is invalid,
4a08705e97f5 Fixes to mail_transaction_log_file_map() error handling.
Timo Sirainen <tss@iki.fi>
parents: 5714
diff changeset
123 -1 if I/O error */
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
124 int mail_transaction_log_file_map(struct mail_transaction_log_file *file,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
125 uoff_t start_offset, uoff_t end_offset);
5714
dcf5dbb6a76a mail_transaction_log_move_to_memory() can't fail anymore. Moved the code to
Timo Sirainen <tss@iki.fi>
parents: 5689
diff changeset
126 void mail_transaction_log_file_move_to_memory(struct mail_transaction_log_file
dcf5dbb6a76a mail_transaction_log_move_to_memory() can't fail anymore. Moved the code to
Timo Sirainen <tss@iki.fi>
parents: 5689
diff changeset
127 *file);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
128
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
129 void mail_transaction_logs_clean(struct mail_transaction_log *log);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
130
5689
c2362f144f15 Initial commit for major index file code cleanup.
Timo Sirainen <tss@iki.fi>
parents: 5687
diff changeset
131 bool mail_transaction_log_want_rotate(struct mail_transaction_log *log);
5849
a9df50952600 Added support for resetting index.
Timo Sirainen <tss@iki.fi>
parents: 5819
diff changeset
132 int mail_transaction_log_rotate(struct mail_transaction_log *log, bool reset);
3146
9a8bf1c86699 Moved code into mail-transaction-log-append.c
Timo Sirainen <tss@iki.fi>
parents: 3106
diff changeset
133 int mail_transaction_log_lock_head(struct mail_transaction_log *log);
9a8bf1c86699 Moved code into mail-transaction-log-append.c
Timo Sirainen <tss@iki.fi>
parents: 3106
diff changeset
134 void mail_transaction_log_file_unlock(struct mail_transaction_log_file *file);
9a8bf1c86699 Moved code into mail-transaction-log-append.c
Timo Sirainen <tss@iki.fi>
parents: 3106
diff changeset
135
9691
b09d9350a2d9 Added ability to specify message's minimum modseq value.
Timo Sirainen <tss@iki.fi>
parents: 9623
diff changeset
136 void mail_transaction_update_modseq(const struct mail_transaction_header *hdr,
b09d9350a2d9 Added ability to specify message's minimum modseq value.
Timo Sirainen <tss@iki.fi>
parents: 9623
diff changeset
137 const void *data, uint64_t *cur_modseq);
7812
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
138 int mail_transaction_log_file_get_highest_modseq_at(
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
139 struct mail_transaction_log_file *file,
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
140 uoff_t offset, uint64_t *highest_modseq_r);
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
141 int mail_transaction_log_file_get_modseq_next_offset(
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
142 struct mail_transaction_log_file *file,
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
143 uint64_t modseq, uoff_t *next_offset_r);
d10cb44ab446 Modseqs are no longer calculated from transaction log sequence + offset.
Timo Sirainen <tss@iki.fi>
parents: 6802
diff changeset
144
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
145 #endif