[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-copy.c, 1.35, 1.36 maildir-list.c, 1.34, 1.35 maildir-mail.c, 1.14, 1.15 maildir-save.c, 1.50, 1.51 maildir-storage.c, 1.96, 1.97 maildir-storage.h, 1.36, 1.37 maildir-sync.c, 1.51, 1.52 maildir-uidlist.c, 1.36, 1.37 maildir-util.c, 1.10, 1.11

cras at dovecot.org cras at dovecot.org
Fri Apr 8 17:32:54 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv25906/lib-storage/index/maildir

Modified Files:
	maildir-copy.c maildir-list.c maildir-mail.c maildir-save.c 
	maildir-storage.c maildir-storage.h maildir-sync.c 
	maildir-uidlist.c maildir-util.c 
Log Message:
Created mbox_storage and maildir_storage.



Index: maildir-copy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-copy.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- maildir-copy.c	8 Apr 2005 13:13:47 -0000	1.35
+++ maildir-copy.c	8 Apr 2005 14:32:51 -0000	1.36
@@ -37,14 +37,14 @@
 			return 0;
 
 		if (ENOSPACE(errno)) {
-			mail_storage_set_error(&mbox->storage->storage,
+			mail_storage_set_error(STORAGE(mbox->storage),
 					       "Not enough disk space");
 			return -1;
 		}
 		if (errno == EACCES || errno == EXDEV)
 			return 1;
 
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 					  "link(%s, %s) failed: %m",
 					  path, ctx->dest_path);
 		return -1;
@@ -138,7 +138,7 @@
 	ctx = t->copy_ctx;
 
 	if (ctx->hardlink &&
-	    mail->box->storage == &ctx->mbox->storage->storage) {
+	    mail->box->storage == STORAGE(ctx->mbox->storage)) {
 		// FIXME: handle dest_mail
 		t_push();
 		ret = maildir_copy_hardlink(mail, ctx);

Index: maildir-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-list.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- maildir-list.c	29 Dec 2004 19:10:27 -0000	1.34
+++ maildir-list.c	8 Apr 2005 14:32:51 -0000	1.35
@@ -198,15 +198,15 @@
 static int maildir_fill_subscribed(struct maildir_list_context *ctx,
 				   struct imap_match_glob *glob)
 {
-	struct index_storage *istorage =
-		(struct index_storage *)ctx->mailbox_ctx.storage;
+	struct maildir_storage *storage =
+		(struct maildir_storage *)ctx->mailbox_ctx.storage;
 	struct subsfile_list_context *subsfile_ctx;
 	const char *path, *name, *p;
 	struct mailbox_node *node;
 	int created;
 
-	path = t_strconcat(istorage->control_dir != NULL ?
-			   istorage->control_dir : istorage->dir,
+	path = t_strconcat(storage->control_dir != NULL ?
+			   storage->control_dir : INDEX_STORAGE(storage)->dir,
 			   "/" SUBSCRIPTION_FILE_NAME, NULL);
 	subsfile_ctx = subsfile_list_init(ctx->mailbox_ctx.storage, path);
 	if (subsfile_ctx == NULL)

Index: maildir-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-mail.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- maildir-mail.c	8 Apr 2005 13:13:47 -0000	1.14
+++ maildir-mail.c	8 Apr 2005 14:32:51 -0000	1.15
@@ -21,7 +21,7 @@
 	if (errno == ENOENT)
 		return 0;
 
-	mail_storage_set_critical(&mbox->storage->storage,
+	mail_storage_set_critical(STORAGE(mbox->storage),
 				  "open(%s) failed: %m", path);
 	return -1;
 }
@@ -36,7 +36,7 @@
 	if (errno == ENOENT)
 		return 0;
 
-	mail_storage_set_critical(&mbox->storage->storage,
+	mail_storage_set_critical(STORAGE(mbox->storage),
 				  "stat(%s) failed: %m", path);
 	return -1;
 }
@@ -88,7 +88,7 @@
 		i_assert(fd != -1);
 
 		if (fstat(fd, &st) < 0) {
-			mail_storage_set_critical(&mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(mbox->storage),
 						  "fstat(maildir) failed: %m");
 			return (time_t)-1;
 		}

Index: maildir-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- maildir-save.c	8 Apr 2005 13:13:47 -0000	1.50
+++ maildir-save.c	8 Apr 2005 14:32:51 -0000	1.51
@@ -62,16 +62,16 @@
 	else {
 		ret = -1;
 		if (ENOSPACE(errno)) {
-			mail_storage_set_error(&ctx->mbox->storage->storage,
+			mail_storage_set_error(STORAGE(ctx->mbox->storage),
 					       "Not enough disk space");
 		} else {
-			mail_storage_set_critical(&ctx->mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 				"link(%s, %s) failed: %m", tmp_path, new_path);
 		}
 	}
 
 	if (unlink(tmp_path) < 0 && errno != ENOENT) {
-		mail_storage_set_critical(&ctx->mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 			"unlink(%s) failed: %m", tmp_path);
 	}
 	t_pop();
@@ -138,7 +138,7 @@
 	ctx->input = input;
 
 	output = o_stream_create_file(ctx->fd, system_pool, 0, FALSE);
-	ctx->output = (ctx->mbox->storage->storage.flags &
+	ctx->output = (STORAGE(ctx->mbox->storage)->flags &
 		       MAIL_STORAGE_FLAG_SAVE_CRLF) != 0 ?
 		o_stream_create_crlf(default_pool, output) :
 		o_stream_create_lf(default_pool, output);
@@ -210,7 +210,7 @@
 
 		if (utime(path, &buf) < 0) {
 			ctx->failed = TRUE;
-			mail_storage_set_critical(&ctx->mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 						  "utime(%s) failed: %m", path);
 		}
 	}
@@ -222,12 +222,12 @@
 	/* FIXME: when saving multiple messages, we could get better
 	   performance if we left the fd open and fsync()ed it later */
 	if (fsync(ctx->fd) < 0) {
-		mail_storage_set_critical(&ctx->mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 					  "fsync(%s) failed: %m", path);
 		ctx->failed = TRUE;
 	}
 	if (close(ctx->fd) < 0) {
-		mail_storage_set_critical(&ctx->mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 					  "close(%s) failed: %m", path);
 		ctx->failed = TRUE;
 	}
@@ -236,16 +236,16 @@
 	if (ctx->failed) {
 		/* delete the tmp file */
 		if (unlink(path) < 0 && errno != ENOENT) {
-			mail_storage_set_critical(&ctx->mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 				"unlink(%s) failed: %m", path);
 		}
 
 		errno = output_errno;
 		if (ENOSPACE(errno)) {
-			mail_storage_set_error(&ctx->mbox->storage->storage,
+			mail_storage_set_error(STORAGE(ctx->mbox->storage),
 					       "Not enough disk space");
 		} else if (errno != 0) {
-			mail_storage_set_critical(&ctx->mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(ctx->mbox->storage),
 				"write(%s) failed: %m", ctx->mbox->path);
 		}
 

Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- maildir-storage.c	8 Apr 2005 13:13:47 -0000	1.96
+++ maildir-storage.c	8 Apr 2005 14:32:51 -0000	1.97
@@ -28,7 +28,7 @@
 
 static const char *maildirs[] = { "cur", "new", "tmp", NULL  };
 
-static int verify_inbox(struct index_storage *storage);
+static int verify_inbox(struct maildir_storage *storage);
 
 static struct mail_storage *
 maildir_create(const char *data, const char *user,
@@ -36,7 +36,8 @@
 	       enum mail_storage_lock_method lock_method)
 {
 	int debug = (flags & MAIL_STORAGE_FLAG_DEBUG) != 0;
-	struct index_storage *storage;
+	struct maildir_storage *storage;
+	struct index_storage *istorage;
 	const char *root_dir, *inbox_dir, *index_dir, *control_dir;
 	const char *home, *path, *p;
 	size_t len;
@@ -118,24 +119,26 @@
 	}
 
 	pool = pool_alloconly_create("storage", 256);
-	storage = p_new(pool, struct index_storage, 1);
-	storage->storage = maildir_storage;
-	storage->storage.pool = pool;
+	storage = p_new(pool, struct maildir_storage, 1);
+	storage->control_dir = p_strdup(pool, home_expand(control_dir));
+
+	istorage = INDEX_STORAGE(storage);
+	istorage->storage = maildir_storage;
+	istorage->storage.pool = pool;
 
 	/* the default ".temp.xxx" prefix would be treated as directory */
-	storage->temp_prefix =
+	istorage->temp_prefix =
 		p_strconcat(pool, "temp.", my_hostname, ".", my_pid, ".", NULL);
 
-	storage->dir = p_strdup(pool, home_expand(root_dir));
-	storage->inbox_path = p_strdup(pool, home_expand(inbox_dir));
-	storage->index_dir = p_strdup(pool, home_expand(index_dir));
-	storage->control_dir = p_strdup(pool, home_expand(control_dir));
-	storage->user = p_strdup(pool, user);
-	storage->callbacks = p_new(pool, struct mail_storage_callbacks, 1);
-	index_storage_init(storage, flags, lock_method);
+	istorage->dir = p_strdup(pool, home_expand(root_dir));
+	istorage->inbox_path = p_strdup(pool, home_expand(inbox_dir));
+	istorage->index_dir = p_strdup(pool, home_expand(index_dir));
+	istorage->user = p_strdup(pool, user);
+	istorage->callbacks = p_new(pool, struct mail_storage_callbacks, 1);
+	index_storage_init(istorage, flags, lock_method);
 
 	(void)verify_inbox(storage);
-	return &storage->storage;
+	return STORAGE(storage);
 }
 
 static void maildir_free(struct mail_storage *_storage)
@@ -260,13 +263,13 @@
 	return t_strconcat(storage->index_dir, "/"MAILDIR_FS_SEP_S, name, NULL);
 }
 
-static const char *maildir_get_control_path(struct index_storage *storage,
+static const char *maildir_get_control_path(struct maildir_storage *storage,
 					    const char *name)
 {
 	if (storage->control_dir == NULL)
-		return maildir_get_path(storage, name);
+		return maildir_get_path(INDEX_STORAGE(storage), name);
 
-	if ((storage->storage.flags & MAIL_STORAGE_FLAG_FULL_FS_ACCESS) != 0 &&
+	if ((STORAGE(storage)->flags & MAIL_STORAGE_FLAG_FULL_FS_ACCESS) != 0 &&
 	    (*name == '/' || *name == '~'))
 		return maildir_get_absolute_path(name, FALSE);
 
@@ -353,7 +356,7 @@
 	return 0;
 }
 
-static int create_control_dir(struct index_storage *storage, const char *name)
+static int create_control_dir(struct maildir_storage *storage, const char *name)
 {
 	const char *dir;
 
@@ -363,7 +366,7 @@
 	dir = t_strconcat(storage->control_dir, "/"MAILDIR_FS_SEP_S,
 			  name, NULL);
 	if (mkdir_parents(dir, CREATE_MODE) < 0 && errno != EEXIST) {
-		mail_storage_set_critical(&storage->storage,
+		mail_storage_set_critical(STORAGE(storage),
 					  "mkdir(%s) failed: %m", dir);
 		return -1;
 	}
@@ -371,18 +374,19 @@
 	return 0;
 }
 
-static int verify_inbox(struct index_storage *storage)
+static int verify_inbox(struct maildir_storage *storage)
 {
+	struct index_storage *istorage = INDEX_STORAGE(storage);
 	const char *path;
 
-	path = storage->inbox_path != NULL ?
-		storage->inbox_path : storage->dir;
+	path = istorage->inbox_path != NULL ?
+		istorage->inbox_path : istorage->dir;
 
-	if (create_maildir(storage, path, TRUE) < 0)
+	if (create_maildir(istorage, path, TRUE) < 0)
 		return -1;
 
 	/* make sure the index directories exist */
-	if (create_index_dir(storage, "INBOX") < 0)
+	if (create_index_dir(istorage, "INBOX") < 0)
 		return -1;
 	if (create_control_dir(storage, "INBOX") < 0)
 		return -1;
@@ -397,9 +401,10 @@
 }
 
 static struct mailbox *
-maildir_open(struct index_storage *storage, const char *name,
+maildir_open(struct maildir_storage *storage, const char *name,
 	     enum mailbox_open_flags flags)
 {
+	struct index_storage *istorage = INDEX_STORAGE(storage);
 	struct maildir_mailbox *mbox;
 	struct mail_index *index;
 	const char *path, *index_dir, *control_dir;
@@ -407,8 +412,8 @@
 	int shared;
 	pool_t pool;
 
-	path = maildir_get_path(storage, name);
-	index_dir = maildir_get_index_path(storage, name);
+	path = maildir_get_path(istorage, name);
+	index_dir = maildir_get_index_path(istorage, name);
 	control_dir = maildir_get_control_path(storage, name);
 
 	index = index_storage_alloc(index_dir, path, MAILDIR_INDEX_PREFIX);
@@ -423,7 +428,7 @@
 	mbox = p_new(pool, struct maildir_mailbox, 1);
 	mbox->ibox.box = maildir_mailbox;
 	mbox->ibox.box.pool = pool;
-	mbox->ibox.storage = storage;
+	mbox->ibox.storage = istorage;
 	mbox->ibox.mail_vfuncs = &maildir_mail_vfuncs;
 	mbox->ibox.is_recent = maildir_is_recent;
 
@@ -453,7 +458,8 @@
 maildir_mailbox_open(struct mail_storage *_storage, const char *name,
 		     struct istream *input, enum mailbox_open_flags flags)
 {
-	struct index_storage *storage = (struct index_storage *)_storage;
+	struct maildir_storage *storage = (struct maildir_storage *)_storage;
+	struct index_storage *istorage = INDEX_STORAGE(storage);
 	const char *path;
 	struct stat st;
 
@@ -476,11 +482,11 @@
 		return NULL;
 	}
 
-	path = maildir_get_path(storage, name);
+	path = maildir_get_path(istorage, name);
 	if (stat(path, &st) == 0) {
 		/* exists - make sure the required directories are also there */
-		if (create_maildir(storage, path, TRUE) < 0 ||
-		    create_index_dir(storage, name) < 0 ||
+		if (create_maildir(istorage, path, TRUE) < 0 ||
+		    create_index_dir(istorage, name) < 0 ||
 		    create_control_dir(storage, name) < 0)
 			return NULL;
 
@@ -765,14 +771,15 @@
 static int maildir_set_subscribed(struct mail_storage *_storage,
 				  const char *name, int set)
 {
-	struct index_storage *storage = (struct index_storage *)_storage;
+	struct maildir_storage *storage = (struct maildir_storage *)_storage;
 	const char *path;
 
 	path = t_strconcat(storage->control_dir != NULL ?
-			   storage->control_dir : storage->dir,
+			   storage->control_dir : INDEX_STORAGE(storage)->dir,
 			   "/" SUBSCRIPTION_FILE_NAME, NULL);
 
-	return subsfile_set_subscribed(_storage, path, storage->temp_prefix,
+	return subsfile_set_subscribed(_storage, path,
+				       INDEX_STORAGE(storage)->temp_prefix,
 				       name, set);
 }
 
@@ -832,6 +839,7 @@
 		       mailbox_notify_callback_t *callback, void *context)
 {
 	struct maildir_mailbox *mbox = (struct maildir_mailbox *)box;
+        struct index_storage *istorage = INDEX_STORAGE(mbox->storage);
 
 	mbox->ibox.min_notify_interval = min_interval;
 	mbox->ibox.notify_callback = callback;
@@ -843,9 +851,9 @@
 	}
 
 	index_mailbox_check_add(&mbox->ibox,
-		t_strconcat(mbox->storage->dir, "/new", NULL), TRUE);
+		t_strconcat(istorage->dir, "/new", NULL), TRUE);
 	index_mailbox_check_add(&mbox->ibox,
-		t_strconcat(mbox->storage->dir, "/cur", NULL), TRUE);
+		t_strconcat(istorage->dir, "/cur", NULL), TRUE);
 }
 
 struct mail_storage maildir_storage = {

Index: maildir-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- maildir-storage.h	8 Apr 2005 13:13:47 -0000	1.36
+++ maildir-storage.h	8 Apr 2005 14:32:51 -0000	1.37
@@ -10,13 +10,24 @@
 
 #include "index-storage.h"
 
+#define STORAGE(maildir_storage) \
+	(&(maildir_storage)->storage.storage)
+#define INDEX_STORAGE(maildir_storage) \
+	(&(maildir_storage)->storage)
+
 struct timeval;
 struct maildir_save_context;
 struct maildir_copy_context;
 
+struct maildir_storage {
+	struct index_storage storage;
+
+	const char *control_dir;
+};
+
 struct maildir_mailbox {
 	struct index_mailbox ibox;
-	struct index_storage *storage;
+	struct maildir_storage *storage;
 
 	const char *path, *control_dir;
 

Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- maildir-sync.c	8 Apr 2005 13:13:47 -0000	1.51
+++ maildir-sync.c	8 Apr 2005 14:32:51 -0000	1.52
@@ -218,7 +218,7 @@
 	if (errno == ENOENT)
 		return 0;
 
-	mail_storage_set_critical(&mbox->storage->storage,
+	mail_storage_set_critical(STORAGE(mbox->storage),
 				  "unlink(%s) failed: %m", path);
 	return -1;
 }
@@ -257,7 +257,7 @@
 		return 1;
 	}
 
-	mail_storage_set_critical(&mbox->storage->storage,
+	mail_storage_set_critical(STORAGE(mbox->storage),
 				  "rename(%s, %s) failed: %m", path, newpath);
 	return -1;
 }
@@ -404,7 +404,7 @@
 		i_warning("Fixed duplicate in %s: %s -> %s",
 			  mbox->path, old_fname, new_fname);
 	} else if (errno != ENOENT) {
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 			"rename(%s, %s) failed: %m", old_path, new_path);
 		ret = -1;
 	}
@@ -415,7 +415,7 @@
 
 static int maildir_scan_dir(struct maildir_sync_context *ctx, int new_dir)
 {
-	struct mail_storage *storage = &ctx->mbox->storage->storage;
+	struct mail_storage *storage = STORAGE(ctx->mbox->storage);
 	const char *dir;
 	DIR *dirp;
 	string_t *src, *dest;
@@ -522,14 +522,14 @@
 	*new_changed_r = *cur_changed_r = FALSE;
 
 	if (stat(ctx->new_dir, &st) < 0) {
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 					  "stat(%s) failed: %m", ctx->new_dir);
 		return -1;
 	}
 	new_mtime = st.st_mtime;
 
 	if (stat(ctx->cur_dir, &st) < 0) {
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 					  "stat(%s) failed: %m", ctx->cur_dir);
 		return -1;
 	}
@@ -619,7 +619,7 @@
 	    uid_validity != 0 && hdr->uid_validity != 0) {
 		/* uidvalidity changed and mailbox isn't being initialized,
 		   index must be rebuilt */
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 			"Maildir %s sync: UIDVALIDITY changed (%u -> %u)",
 			mbox->path, hdr->uid_validity, uid_validity);
 		mail_index_mark_corrupted(mbox->ibox.index);
@@ -668,7 +668,7 @@
 				if ((uflags &
 				     MAILDIR_UIDLIST_REC_FLAG_RACING) != 0) {
 					mail_storage_set_critical(
-						&mbox->storage->storage,
+						STORAGE(mbox->storage),
 						"Maildir %s sync: "
 						"UID < next_uid "
 						"(%u < %u, file = %s)",
@@ -720,7 +720,7 @@
 			}
 			if ((uflags & MAILDIR_UIDLIST_REC_FLAG_RACING) != 0) {
 				mail_storage_set_critical(
-					&mbox->storage->storage,
+					STORAGE(mbox->storage),
 					"Maildir %s sync: "
 					"UID inserted in the middle of mailbox "
 					"(%u > %u, file = %s)",

Index: maildir-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-uidlist.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- maildir-uidlist.c	8 Apr 2005 13:13:47 -0000	1.36
+++ maildir-uidlist.c	8 Apr 2005 14:32:51 -0000	1.37
@@ -88,7 +88,7 @@
 	if (fd == -1) {
 		if (errno == EAGAIN)
 			return 0;
-		mail_storage_set_critical(&uidlist->mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(uidlist->mbox->storage),
 			"file_dotlock_open(%s) failed: %m", path);
 		return -1;
 	}
@@ -139,7 +139,7 @@
 	uidlist->dotlock_settings.immediate_stale_timeout =
 		UIDLIST_LOCK_STALE_TIMEOUT;
 	uidlist->dotlock_settings.temp_prefix =
-		uidlist->mbox->storage->temp_prefix;
+		INDEX_STORAGE(mbox->storage)->temp_prefix;
 
 	return uidlist;
 }
@@ -179,12 +179,12 @@
 
 	if (uid == 0 || *line != ' ') {
 		/* invalid file */
-                mail_storage_set_critical(&uidlist->mbox->storage->storage,
+                mail_storage_set_critical(STORAGE(uidlist->mbox->storage),
 			"Invalid data in file %s", uidlist->fname);
 		return 0;
 	}
 	if (uid <= uidlist->prev_read_uid) {
-                mail_storage_set_critical(&uidlist->mbox->storage->storage,
+                mail_storage_set_critical(STORAGE(uidlist->mbox->storage),
 			"UIDs not ordered in file %s (%u > %u)",
 			uidlist->fname, uid, uidlist->prev_read_uid);
 		return 0;
@@ -198,7 +198,7 @@
         uidlist->last_seen_uid = uid;
 
 	if (uid >= uidlist->next_uid) {
-                mail_storage_set_critical(&uidlist->mbox->storage->storage,
+                mail_storage_set_critical(STORAGE(uidlist->mbox->storage),
 			"UID larger than next_uid in file %s (%u >= %u)",
 			uidlist->fname, uid, uidlist->next_uid);
 		return 0;
@@ -213,7 +213,7 @@
 	}
 
 	if (hash_lookup_full(uidlist->files, line, NULL, NULL)) {
-                mail_storage_set_critical(&uidlist->mbox->storage->storage,
+                mail_storage_set_critical(STORAGE(uidlist->mbox->storage),
 			"Duplicate file in uidlist file %s: %s",
 			uidlist->fname, line);
 		return 0;
@@ -230,7 +230,7 @@
 
 int maildir_uidlist_update(struct maildir_uidlist *uidlist)
 {
-	struct mail_storage *storage = &uidlist->mbox->storage->storage;
+	struct mail_storage *storage = STORAGE(uidlist->mbox->storage);
 	const char *line;
 	unsigned int uid_validity, next_uid;
 	struct istream *input;
@@ -443,7 +443,7 @@
 static int maildir_uidlist_rewrite_fd(struct maildir_uidlist *uidlist,
 				      const char *temp_path)
 {
-	struct mail_storage *storage = &uidlist->mbox->storage->storage;
+	struct mail_storage *storage = STORAGE(uidlist->mbox->storage);
 	struct maildir_uidlist_iter_ctx *iter;
 	struct utimbuf ut;
 	string_t *str;
@@ -528,7 +528,7 @@
 				      "/" MAILDIR_UIDLIST_NAME, NULL);
 
 		if (file_dotlock_replace(&uidlist->dotlock, 0) <= 0) {
-			mail_storage_set_critical(&mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(mbox->storage),
 				"file_dotlock_replace(%s) failed: %m", db_path);
 			(void)unlink(temp_path);
 			ret = -1;

Index: maildir-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-util.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- maildir-util.c	8 Apr 2005 13:13:47 -0000	1.10
+++ maildir-util.c	8 Apr 2005 14:32:51 -0000	1.11
@@ -56,7 +56,7 @@
 	}
 
 	if (i == 10) {
-		mail_storage_set_critical(&mbox->storage->storage,
+		mail_storage_set_critical(STORAGE(mbox->storage),
 			"maildir_file_do(%s) racing", mbox->path);
 	}
 
@@ -244,10 +244,10 @@
 	*fname_r = t_strdup(path);
 	if (fd == -1) {
 		if (ENOSPACE(errno)) {
-			mail_storage_set_error(&mbox->storage->storage,
+			mail_storage_set_error(STORAGE(mbox->storage),
 					       "Not enough disk space");
 		} else {
-			mail_storage_set_critical(&mbox->storage->storage,
+			mail_storage_set_critical(STORAGE(mbox->storage),
 						  "open(%s) failed: %m", path);
 		}
 	}



More information about the dovecot-cvs mailing list