Mercurial > dovecot > core-2.2
comparison src/lib-index/mail-index.c @ 22610:bf758ce6ee6d
lib-index: Add mail_index_base_optimization_settings
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 09 Oct 2017 15:24:45 +0300 |
parents | b7e049f3aa16 |
children | 65ada9976a7f |
comparison
equal
deleted
inserted
replaced
22609:b7e049f3aa16 | 22610:bf758ce6ee6d |
---|---|
28 struct mail_index_module_register mail_index_module_register = { 0 }; | 28 struct mail_index_module_register mail_index_module_register = { 0 }; |
29 | 29 |
30 static void mail_index_close_nonopened(struct mail_index *index); | 30 static void mail_index_close_nonopened(struct mail_index *index); |
31 | 31 |
32 static const struct mail_index_optimization_settings default_optimization_set = { | 32 static const struct mail_index_optimization_settings default_optimization_set = { |
33 .index = { | |
34 .rewrite_min_log_bytes = 8 * 1024, | |
35 .rewrite_max_log_bytes = 128 * 1024, | |
36 }, | |
33 .log = { | 37 .log = { |
34 .min_size = 32 * 1024, | 38 .min_size = 32 * 1024, |
35 .max_size = 1024 * 1024, | 39 .max_size = 1024 * 1024, |
36 .min_age_secs = 5 * 60, | 40 .min_age_secs = 5 * 60, |
37 .log2_max_age_secs = 3600 * 24 * 2, | 41 .log2_max_age_secs = 3600 * 24 * 2, |
161 const struct mail_index_optimization_settings *set) | 165 const struct mail_index_optimization_settings *set) |
162 { | 166 { |
163 struct mail_index_optimization_settings *dest = | 167 struct mail_index_optimization_settings *dest = |
164 &index->optimization_set; | 168 &index->optimization_set; |
165 | 169 |
170 /* index */ | |
171 if (set->index.rewrite_min_log_bytes != 0) | |
172 dest->index.rewrite_min_log_bytes = set->index.rewrite_min_log_bytes; | |
173 if (set->index.rewrite_max_log_bytes != 0) | |
174 dest->index.rewrite_max_log_bytes = set->index.rewrite_max_log_bytes; | |
175 | |
176 /* log */ | |
166 if (set->log.min_size != 0) | 177 if (set->log.min_size != 0) |
167 dest->log.min_size = set->log.min_size; | 178 dest->log.min_size = set->log.min_size; |
168 if (set->log.max_size != 0) | 179 if (set->log.max_size != 0) |
169 dest->log.max_size = set->log.max_size; | 180 dest->log.max_size = set->log.max_size; |
170 if (set->log.min_age_secs != 0) | 181 if (set->log.min_age_secs != 0) |