mdbox-purge.c revision 0f3d4fbcf88e2ffd674893aed8cc1288fe17d290
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz/* Copyright (c) 2007-2016 Dovecot authors, see the included COPYING file */
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz Altmoving works like:
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz 1. Message's DBOX_INDEX_FLAG_ALT flag is changed. This is caught by mdbox
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz code and map UID's alt-refcount is updated. It won't be written to disk.
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz 2. mdbox_purge() is called, which checks if map UID's refcount equals
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz to its alt-refcount. If it does, it's moved to alt storage. Moving to
51ed197520dd9ea534fbc3bc1790ebe3cb5421e2Michael M Slusarz primary storage is done if _ALT flag was removed from any message.
bool have_altmoves;
const unsigned char *data;
int ret;
sizeof(*meta_hdr_r));
if (ret <= 0) {
const char *line;
int ret;
return ret;
const char *line;
int ret;
return ret;
extrefs)) {
} T_END;
void *value;
return TRUE;
return FALSE;
return ret;
unsigned int i, count;
int ret;
for (i = 0; i < count; i++) {
&refcount);
if (ret <= 0) {
if (ret < 0)
if (refcount > 0)
int ret = 0;
return ret;
unsigned int i, count;
int ret;
return ret;
&msgs_arr) < 0) {
for (i = 0; i < count; i++) {
ret = 0;
&ext_refs);
if (ret <= 0)
if (ret <= 0)
ret = 0;
if (ret <= 0)
if (ret <= 0) {
&expunged_map_uids) < 0 ||
if (ret > 0) {
return ret;
static struct mdbox_purge_context *
return ctx;
struct dirent *d;
int ret = 0;
&file_id) < 0)
if (errno != 0) {
return ret;
int ret = 0;
count = 0;
cur_map_uid = 0;
for (i = 0; i < count; i++) {
alt_refcount++;
count = 0;
cur_map_uid = 0;
for (i = 0; i < count; i++) {
return ret;
bool deleted;
int ret;
while (ret == 0 &&
} T_END;
return ret;