mdbox-map.c revision 2b6bc2e46d5e7aec8d44089682c4867815063c91
24daenzerorama/* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
24daenzerorama#include "lib.h"
24daenzerorama#include "array.h"
24daenzerorama#include "hash.h"
24daenzerorama#include "ostream.h"
24daenzerorama#include "mkdir-parents.h"
24daenzerorama#include "unlink-old-files.h"
24daenzerorama#include "mailbox-list-private.h"
24daenzerorama#include "mdbox-storage.h"
24daenzerorama#include "mdbox-file.h"
24daenzerorama#include "mdbox-map-private.h"
24daenzerorama#include <stdlib.h>
30daenzerorama#include <dirent.h>
30daenzerorama "mdbox map %s corrupted: %s",
struct mdbox_map *
sizeof(struct mdbox_map_mail_index_header),
sizeof(struct mdbox_map_mail_index_record),
sizeof(uint32_t));
return map;
int ret;
return ret;
int ret = 0;
if (create_missing) {
if (ret > 0) {
if (ret < 0) {
if (ret == 0) {
bool delayed_expunges;
const void *data;
const void *data;
bool expunged;
int ret;
return ret;
const void *data;
bool expunged;
int ret;
return ret;
const void *data;
bool expunged;
const void *data;
bool expunged;
int ret;
return ret;
if (*ref16_p != 0)
return atomic;
int ret;
if (ret <= 0) {
int ret = 0;
return ret;
struct mdbox_map_transaction_context *
bool external)
bool success;
if (external)
if (success) {
flags);
return ctx;
const void *data;
bool expunged;
if (diff > 0) {
map_uid);
unsigned int i, count;
for (i = 0; i < count; i++) {
const void *data;
bool expunged;
int ret = 0;
if (ret == 0)
return ret;
struct mdbox_map_append_context *
return ctx;
if (interval == 0)
bool notfound;
if (want_altpath) {
return FALSE;
return FALSE;
if (notfound)
return FALSE;
return FALSE;
return FALSE;
return TRUE;
bool want_altpath,
int ret;
return TRUE;
return TRUE;
return !file_too_old;
unsigned int i, count;
for (i = 0; i < count; i++) {
return TRUE;
return FALSE;
static struct dbox_file_append_context *
unsigned int i, count;
return NULL;
return append;
return NULL;
struct dirent *d;
int ret = 0;
&file_id) < 0)
if (errno != 0) {
if (ret < 0)
unsigned int backwards_lookup_count;
bool retry_later;
if (!want_altpath)
seq++;
int ret;
if (ret > 0)
else if (ret < 0)
if (ret <= 0) {
if (!existing) {
unsigned int count;
unsigned int count;
struct dirent *d;
bool separate_transaction)
unsigned int i, count;
for (i = 0; i < count; i++) {
file_id--;
unsigned int i, count;
int ret = 0;
*first_map_uid_r = 0;
*last_map_uid_r = 0;
for (i = 0; i < count; i++) {
return ret;
for (i = j = 0; i < map_uids_count; i++) {
i_unreached();
i_unreached();
unsigned int i, count;
for (i = 0; i < count; i++) {
unsigned int i, count;
for (i = 0; i < count; i++) {
for (i = 0; i < count; i++) {
int ret;
if (ret <= 0) {
if (uid_validity == 0)
return uid_validity;