Lines Matching refs:storage

18 #include "mdbox-storage.h"
28 mdbox_find_and_move_open_file(struct mdbox_storage *storage, uint32_t file_id)
33 files = array_get(&storage->open_files, &count);
41 void mdbox_files_free(struct mdbox_storage *storage)
46 files = array_get(&storage->open_files, &count);
49 array_clear(&storage->open_files);
52 void mdbox_files_sync_input(struct mdbox_storage *storage)
57 files = array_get(&storage->open_files, &count);
65 mdbox_close_open_files(struct mdbox_storage *storage, unsigned int close_count)
70 files = array_get(&storage->open_files, &count);
74 array_delete(&storage->open_files, i, 1);
79 files = array_get(&storage->open_files, &count);
92 i_strdup_printf("%s/%s", file->storage->storage_dir, fname);
93 if (file->storage->alt_storage_dir != NULL) {
95 i_strdup_printf("%s/%s", file->storage->alt_storage_dir,
109 _file->fd = _file->storage->v.
114 if (file->storage->preallocate_space) {
116 file->storage->set->mdbox_rotate_size);
130 file->storage->preallocate_space = FALSE;
137 mdbox_file_init_full(struct mdbox_storage *storage,
145 mdbox_find_and_move_open_file(storage, file_id);
151 count = array_count(&storage->open_files);
153 mdbox_close_open_files(storage,
158 file->storage = storage;
159 file->file.storage = &storage->storage;
169 array_append(&storage->open_files, &file, 1);
176 mdbox_file_init(struct mdbox_storage *storage, uint32_t file_id)
178 return mdbox_file_init_full(storage, file_id, FALSE);
182 mdbox_file_init_new_alt(struct mdbox_storage *storage)
184 return mdbox_file_init_full(storage, 0, TRUE);
199 file->storage->storage_dir : file->storage->alt_storage_dir;
203 mail_storage_set_critical(&file->file.storage->storage,
205 mdbox_storage_set_corrupted(file->storage);
209 mail_storage_set_critical(&file->storage->storage.storage,
217 array_append(&file->storage->open_files, &file, 1);
222 mdbox_find_oldest_unused_file(struct mdbox_storage *storage,
228 files = array_get(&storage->open_files, &count);
242 static void mdbox_file_close_timeout(struct mdbox_storage *storage)
248 while ((oldest = mdbox_find_oldest_unused_file(storage, &i)) != NULL) {
251 array_delete(&storage->open_files, i, 1);
256 timeout_remove(&storage->to_close_unused_files);
261 if (mfile->storage->to_close_unused_files == NULL) {
262 mfile->storage->to_close_unused_files =
264 mdbox_file_close_timeout, mfile->storage);
279 count = array_count(&mfile->storage->open_files);
287 oldest_file = mdbox_find_oldest_unused_file(mfile->storage, &i);
289 array_delete(&mfile->storage->open_files, i, 1);
303 struct mdbox_map *map = mfile->storage->map;
321 mail_storage_copy_list_error(&file->storage->storage,
331 mail_storage_set_critical(&file->storage->storage,
337 mail_storage_set_critical(&file->storage->storage, "%s",
342 mail_storage_set_critical(&file->storage->storage,