mail-cache-sync-update.c revision b14bdce468df7d98afb3e5e8c71b74a75cad2453
/* Copyright (c) 2004-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "file-cache.h"
#include "mail-cache-private.h"
#include "mail-index-view-private.h"
#include "mail-index-sync-private.h"
struct mail_cache_sync_context {
unsigned int locked:1;
unsigned int lock_failed:1;
unsigned int nfs_read_cache_flushed:1;
};
struct mail_cache_sync_context *ctx)
{
return;
}
{
struct mail_cache_sync_context *ctx;
else {
}
return ctx;
}
struct mail_cache *cache)
{
int ret;
if (ctx->lock_failed)
return 0;
return ret;
}
}
return 1;
}
{
const struct mail_index_ext *ext;
return FALSE;
return TRUE;
}
void **sync_context, void *context)
{
int ret;
*sync_context = NULL;
return 0;
}
if (*cache_offset == 0)
return 0;
if (ret <= 0)
return ret;
return 0;
if (!MAIL_CACHE_IS_UNUSABLE(cache) &&
return 0;
}
void **context)
{
int ret;
if (new_cache_offset == NULL) {
return 1;
}
/* flush read cache only once per sync */
if (!ctx->nfs_read_cache_flushed &&
}
/* don't invalidate anything that's already been invalidated
within this sync. */
}
}
return 1;
&cur_seq, &cur_offset);
&tail_seq, &tail_offset);
/* already been linked */
return 1;
}
/* we'll need to link the old and new cache records */
if (ret <= 0)
return 1;
/* cache has been compressed, don't modify it */
return 1;
}
return -1;
return 1;
}
{
if (!MAIL_CACHE_IS_UNUSABLE(cache)) {
}
}