if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE)
return mail_set_aborted(mail);
- p->stats_dentry_lookup_count++;
+ p->stats_stat_lookup_count++;
path = cydir_mail_get_path(mail);
if (stat(path, st_r) < 0) {
if (errno == ENOENT)
int fd;
if (mail->data.stream == NULL) {
- mail->mail.stats_dentry_lookup_count++;
+ mail->mail.stats_open_lookup_count++;
path = cydir_mail_get_path(_mail);
fd = open(path, O_RDONLY);
if (fd == -1) {
}
if (!dbox_file_is_open(mail->open_file))
- mail->imail.mail.stats_dentry_lookup_count++;
+ mail->imail.mail.stats_open_lookup_count++;
if (dbox_file_open(mail->open_file, &deleted) <= 0)
return -1;
if (deleted) {
if (data->save_date == 0) {
/* missing / corrupted save time - use the file's ctime */
i_assert(file->fd != -1);
- mail->imail.mail.stats_attr_lookup_count++;
+ mail->imail.mail.stats_fstat_lookup_count++;
if (fstat(file->fd, &st) < 0) {
mail_storage_set_critical(_mail->box->storage,
"fstat(%s) failed: %m", file->current_path);
static unsigned long long search_mail_get_cost(struct mail_private *mail)
{
- return mail->stats_dentry_lookup_count * SEARCH_COST_DENTRY +
- mail->stats_attr_lookup_count * SEARCH_COST_ATTR +
+ return mail->stats_open_lookup_count * SEARCH_COST_DENTRY +
+ mail->stats_stat_lookup_count * SEARCH_COST_DENTRY +
+ mail->stats_fstat_lookup_count * SEARCH_COST_ATTR +
mail->stats_cache_hit_count * SEARCH_COST_CACHE +
mail->stats_files_read_count * SEARCH_COST_FILES_READ +
(mail->stats_files_read_bytes/1024) * SEARCH_COST_KBYTE;
*deleted_r = FALSE;
- p->stats_dentry_lookup_count++;
+ p->stats_open_lookup_count++;
if (mail->uid != 0) {
if (maildir_file_do(mbox, mail->uid, do_open, &fd) < 0)
return NULL;
fd = i_stream_get_fd(imail->data.stream);
i_assert(fd != -1);
- imail->mail.stats_attr_lookup_count++;
+ imail->mail.stats_fstat_lookup_count++;
if (fstat(fd, st) < 0) {
mail_storage_set_critical(&mbox->storage->storage,
"fstat(maildir) failed: %m");
return -1;
}
} else if (mail->uid != 0) {
- imail->mail.stats_dentry_lookup_count++;
+ imail->mail.stats_stat_lookup_count++;
ret = maildir_file_do(mbox, mail->uid, do_stat, st);
if (ret <= 0) {
if (ret == 0)
return -1;
}
} else {
- imail->mail.stats_dentry_lookup_count++;
+ imail->mail.stats_stat_lookup_count++;
path = maildir_save_file_get_path(mail->transaction, mail->seq);
if (stat(path, st) < 0) {
mail_storage_set_critical(mail->box->storage,
if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE)
return mail_set_aborted(mail);
- p->stats_attr_lookup_count++;
+ p->stats_fstat_lookup_count++;
st = i_stream_stat(mbox->input, TRUE);
if (st == NULL) {
mail_storage_set_critical(mail->box->storage,
/* these statistics are never reset by mail-storage API: */
- /* open(), stat(), .. */
- unsigned long stats_dentry_lookup_count;
- /* fstat() mostly */
- unsigned long stats_attr_lookup_count;
+ unsigned long stats_open_lookup_count;
+ unsigned long stats_stat_lookup_count;
+ unsigned long stats_fstat_lookup_count;
/* number of files we've opened and read */
unsigned long stats_files_read_count;
/* number of bytes we've had to read from files */