[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.105, 1.106 index-storage.h, 1.115, 1.116

tss at dovecot.org tss at dovecot.org
Fri Mar 30 15:44:03 EEST 2007


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

Modified Files:
	index-storage.c index-storage.h 
Log Message:
Removed struct index_storage abstraction. It's pointless.



Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- index-storage.c	29 Mar 2007 11:51:25 -0000	1.105
+++ index-storage.c	30 Mar 2007 12:44:01 -0000	1.106
@@ -40,27 +40,27 @@
 static struct timeout *to_index = NULL;
 static int index_storage_refcount = 0;
 
-void index_storage_init(struct index_storage *storage,
+void index_storage_init(struct mail_storage *storage,
 			struct mailbox_list *list,
 			enum mail_storage_flags flags,
 			enum file_lock_method lock_method)
 {
-	storage->storage.list = list;
-	storage->storage.flags = flags;
-	storage->storage.lock_method = lock_method;
+	storage->list = list;
+	storage->flags = flags;
+	storage->lock_method = lock_method;
 
-	storage->storage.callbacks =
-		p_new(storage->storage.pool, struct mail_storage_callbacks, 1);
+	storage->callbacks =
+		p_new(storage->pool, struct mail_storage_callbacks, 1);
 
-	array_create(&storage->storage.module_contexts,
-		     storage->storage.pool, sizeof(void *), 5);
+	array_create(&storage->module_contexts,
+		     storage->pool, sizeof(void *), 5);
 	index_storage_refcount++;
 }
 
-void index_storage_deinit(struct index_storage *storage)
+void index_storage_deinit(struct mail_storage *storage)
 {
-	mailbox_list_deinit(storage->storage.list);
-	i_free(storage->storage.error);
+	mailbox_list_deinit(storage->list);
+	i_free(storage->error);
 
 	if (--index_storage_refcount > 0)
 		return;
@@ -322,7 +322,7 @@
 
 void index_storage_mailbox_open(struct index_mailbox *ibox)
 {
-	struct mail_storage *storage = &ibox->storage->storage;
+	struct mail_storage *storage = ibox->storage;
 	enum mail_index_open_flags index_flags = 0;
 	int ret;
 
@@ -369,7 +369,7 @@
 				enum mailbox_open_flags flags,
 				bool move_to_memory)
 {
-	struct mail_storage *storage = &ibox->storage->storage;
+	struct mail_storage *storage = ibox->storage;
 
 	i_assert(name != NULL);
 
@@ -437,14 +437,12 @@
 	return mail_index_view_is_inconsistent(ibox->view);
 }
 
-void index_storage_set_callbacks(struct mail_storage *_storage,
+void index_storage_set_callbacks(struct mail_storage *storage,
 				 struct mail_storage_callbacks *callbacks,
 				 void *context)
 {
-	struct index_storage *storage = (struct index_storage *) _storage;
-
-	*storage->storage.callbacks = *callbacks;
-	storage->storage.callback_context = context;
+	*storage->callbacks = *callbacks;
+	storage->callback_context = context;
 }
 
 const char *index_storage_get_last_error(struct mail_storage *storage,

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- index-storage.h	29 Mar 2007 11:51:25 -0000	1.115
+++ index-storage.h	30 Mar 2007 12:44:01 -0000	1.116
@@ -21,17 +21,11 @@
 	MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE
 };
 
-struct index_storage {
-	struct mail_storage storage;
-
-	const char *user; /* name of user accessing the storage */
-};
-
 struct index_mailbox {
 	struct mailbox box;
 	union mail_index_module_context index_module_ctx;
 
-	struct index_storage *storage;
+	struct mail_storage *storage;
 	enum mailbox_open_flags open_flags;
 
 	struct mail_index *index;
@@ -107,11 +101,11 @@
 void index_storage_unref(struct mail_index *index);
 void index_storage_destroy_unrefed(void);
 
-void index_storage_init(struct index_storage *storage,
+void index_storage_init(struct mail_storage *storage,
 			struct mailbox_list *list,
 			enum mail_storage_flags flags,
 			enum file_lock_method lock_method);
-void index_storage_deinit(struct index_storage *storage);
+void index_storage_deinit(struct mail_storage *storage);
 
 void index_storage_mailbox_init(struct index_mailbox *ibox, const char *name,
 				enum mailbox_open_flags flags,



More information about the dovecot-cvs mailing list