rpms/evolution-data-server/F-13 evolution-data-server-2.30.1-gn550414.patch, NONE, 1.1 evolution-data-server.spec, 1.299, 1.300

Milan Crha mcrha at fedoraproject.org
Thu Jun 10 07:56:14 UTC 2010


Author: mcrha

Update of /cvs/pkgs/rpms/evolution-data-server/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv29369

Modified Files:
	evolution-data-server.spec 
Added Files:
	evolution-data-server-2.30.1-gn550414.patch 
Log Message:
* Thu Jun 10 2010 Milan Crha <mcrha at redhat.com> - 2.30.1-3.fc13
- Add patch for Red Hat bug #602144 (summary and folder mismatch,
  even after sync)


evolution-data-server-2.30.1-gn550414.patch:
 camel-folder-summary.c               |   43 +++++++++++++++++++++++------------
 camel-folder-summary.h               |    3 ++
 camel-private.h                      |   14 +++++------
 providers/local/camel-mbox-summary.c |   17 +++++++++++--
 providers/local/camel-mbox-summary.h |    2 -
 5 files changed, 54 insertions(+), 25 deletions(-)

--- NEW FILE evolution-data-server-2.30.1-gn550414.patch ---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 41ab96b..0ab6887 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -168,11 +168,11 @@ camel_folder_summary_init (CamelFolderSummary *s)
 	s->uids = g_ptr_array_new ();
 	s->loaded_infos = g_hash_table_new (g_str_hash, g_str_equal);
 
-	p->summary_lock = g_mutex_new();
-	p->io_lock = g_mutex_new();
-	p->filter_lock = g_mutex_new();
-	p->alloc_lock = g_mutex_new();
-	p->ref_lock = g_mutex_new();
+	g_static_rec_mutex_init (&p->summary_lock);
+	g_static_rec_mutex_init (&p->io_lock);
+	g_static_rec_mutex_init (&p->filter_lock);
+	g_static_rec_mutex_init (&p->alloc_lock);
+	g_static_rec_mutex_init (&p->ref_lock);
 
 	s->meta_summary = g_malloc0(sizeof(CamelFolderMetaSummary));
 
@@ -239,11 +239,11 @@ camel_folder_summary_finalize (CamelObject *obj)
 	g_free(s->meta_summary->path);
 	g_free(s->meta_summary);
 
-	g_mutex_free(p->summary_lock);
-	g_mutex_free(p->io_lock);
-	g_mutex_free(p->filter_lock);
-	g_mutex_free(p->alloc_lock);
-	g_mutex_free(p->ref_lock);
+	g_static_rec_mutex_free (&p->summary_lock);
+	g_static_rec_mutex_free (&p->io_lock);
+	g_static_rec_mutex_free (&p->filter_lock);
+	g_static_rec_mutex_free (&p->alloc_lock);
+	g_static_rec_mutex_free (&p->ref_lock);
 
 	g_free(p);
 }
@@ -573,8 +573,6 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
 		folder_name = s->folder->full_name;
 		cdb = s->folder->parent_store->cdb_r;
 
-		CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
 		data.summary = s;
 		data.double_ref = TRUE;
 		data.add = FALSE;
@@ -582,11 +580,10 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
 		ret = camel_db_read_message_info_record_with_uid (cdb, folder_name, uid, &data, camel_read_mir_callback, &ex);
 		if (ret != 0) {
 			camel_exception_clear (&ex);
+			CAMEL_SUMMARY_UNLOCK(s, summary_lock);
 			return NULL;
 		}
 
-		CAMEL_SUMMARY_LOCK(s, summary_lock);
-
 		/* We would have double reffed at camel_read_mir_callback */
 		info = g_hash_table_lookup (s->loaded_infos, uid);
 
@@ -5216,3 +5213,21 @@ camel_folder_summary_guess_content_info (CamelMessageInfo *mi, CamelContentType
 
 	return NULL;
 }
+
+void
+camel_folder_summary_lock_summary (CamelFolderSummary *summary)
+{
+	g_return_if_fail (summary != NULL);
+	g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
+
+	CAMEL_SUMMARY_LOCK (summary, summary_lock);
+}
+
+void
+camel_folder_summary_unlock_summary (CamelFolderSummary *summary)
+{
+	g_return_if_fail (summary != NULL);
+	g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
+
+	CAMEL_SUMMARY_UNLOCK (summary, summary_lock);
+}
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 98629b5..6437a37 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -514,6 +514,9 @@ void camel_message_info_dump (CamelMessageInfo *mi);
 /* Migration code */
 gint camel_folder_summary_migrate_infos(CamelFolderSummary *s);
 
+void camel_folder_summary_lock_summary (CamelFolderSummary *summary);
+void camel_folder_summary_unlock_summary (CamelFolderSummary *summary);
+
 G_END_DECLS
 
 #endif /* _CAMEL_FOLDER_SUMMARY_H */
diff --git a/camel/camel-private.h b/camel/camel-private.h
index 51fc00f..2a4d666 100644
--- a/camel/camel-private.h
+++ b/camel/camel-private.h
@@ -119,11 +119,11 @@ struct _CamelFolderSummaryPrivate {
 
 	struct _CamelIndex *index;
 
-	GMutex *summary_lock;	/* for the summary hashtable/array */
-	GMutex *io_lock;	/* load/save lock, for access to saved_count, etc */
-	GMutex *filter_lock;	/* for accessing any of the filtering/indexing stuff, since we share them */
-	GMutex *alloc_lock;	/* for setting up and using allocators */
-	GMutex *ref_lock;	/* for reffing/unreffing messageinfo's ALWAYS obtain before summary_lock */
+	GStaticRecMutex summary_lock;	/* for the summary hashtable/array */
+	GStaticRecMutex io_lock;	/* load/save lock, for access to saved_count, etc */
+	GStaticRecMutex filter_lock;	/* for accessing any of the filtering/indexing stuff, since we share them */
+	GStaticRecMutex alloc_lock;	/* for setting up and using allocators */
+	GStaticRecMutex ref_lock;	/* for reffing/unreffing messageinfo's ALWAYS obtain before summary_lock */
 	GHashTable *flag_cache;
 
 	gboolean need_preview;
@@ -131,9 +131,9 @@ struct _CamelFolderSummaryPrivate {
 };
 
 #define CAMEL_SUMMARY_LOCK(f, l) \
-	(g_mutex_lock(((CamelFolderSummary *) (f))->priv->l))
+	(g_static_rec_mutex_lock (&((CamelFolderSummary *) (f))->priv->l))
 #define CAMEL_SUMMARY_UNLOCK(f, l) \
-	(g_mutex_unlock(((CamelFolderSummary *) (f))->priv->l))
+	(g_static_rec_mutex_unlock (&((CamelFolderSummary *) (f))->priv->l))
 
 struct _CamelStoreSummaryPrivate {
 	GMutex *summary_lock;	/* for the summary hashtable/array */
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 0fdd84e..96de86a 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -452,10 +452,13 @@ message_info_load(CamelFolderSummary *s, FILE *in)
 
 	mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_load(s, in);
 	if (mi) {
+		off_t fp;
 		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
 
-		if (camel_file_util_decode_off_t(in, &mbi->frompos) == -1)
+		if (camel_file_util_decode_off_t(in, &fp) == -1)
 			goto error;
+
+		mbi->frompos = (goffset) fp;
 	}
 
 	return mi;
@@ -472,7 +475,7 @@ meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMe
 	io(printf("saving mbox message info\n"));
 
 	if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->meta_message_info_save(s, out_meta, out, mi) == -1
-	    || camel_file_util_encode_off_t(out_meta, mbi->frompos) == -1)
+	    || camel_file_util_encode_off_t(out_meta, (off_t) mbi->frompos) == -1)
 		return -1;
 
 	return 0;
@@ -498,7 +501,7 @@ message_info_save(CamelFolderSummary *s, FILE *out, CamelMessageInfo *mi)
 	io(printf("saving mbox message info\n"));
 
 	if (((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_save(s, out, mi) == -1
-	    || camel_file_util_encode_off_t (out, mbi->frompos) == -1)
+	    || camel_file_util_encode_off_t (out, (off_t) mbi->frompos) == -1)
 		return -1;
 
 	return 0;
@@ -866,6 +869,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
 	camel_mime_parser_scan_pre_from(mp, TRUE);
 	camel_mime_parser_init_with_fd(mp, pfd);
 
+	camel_folder_summary_lock_summary (s);
 	/* Sync only the changes */
 	summary = camel_folder_summary_get_changed ((CamelFolderSummary *)mbs);
 	if (summary->len)
@@ -965,6 +969,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
 	camel_object_unref((CamelObject *)mp);
 
 	camel_operation_end(NULL);
+	camel_folder_summary_unlock_summary (s);
 
 	return 0;
  error:
@@ -978,6 +983,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
 		camel_message_info_free((CamelMessageInfo *)info);
 
 	camel_operation_end(NULL);
+	camel_folder_summary_unlock_summary (s);
 
 	return -1;
 }
@@ -1091,6 +1097,7 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
 	camel_mime_parser_scan_pre_from(mp, TRUE);
 	camel_mime_parser_init_with_fd(mp, fd);
 
+	camel_folder_summary_lock_summary (s);
 	count = camel_folder_summary_count(s);
 	for (i = 0; i < count; i++) {
 		gint pc = (i + 1) * 100 / count;
@@ -1256,6 +1263,8 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
 	if (touched)
 		camel_folder_summary_header_save_to_db (s, ex);
 
+	camel_folder_summary_unlock_summary (s);
+
 	return 0;
  error:
 	g_free(xevnew);
@@ -1265,6 +1274,8 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
 	if (info)
 		camel_message_info_free((CamelMessageInfo *)info);
 
+	camel_folder_summary_unlock_summary (s);
+
 	return -1;
 }
 
diff --git a/camel/providers/local/camel-mbox-summary.h b/camel/providers/local/camel-mbox-summary.h
index 4bd3a92..d1b40f1 100644
--- a/camel/providers/local/camel-mbox-summary.h
+++ b/camel/providers/local/camel-mbox-summary.h
@@ -42,7 +42,7 @@ typedef struct _CamelMboxMessageContentInfo {
 typedef struct _CamelMboxMessageInfo {
 	CamelLocalMessageInfo info;
 
-	off_t frompos;
+	goffset frompos;
 } CamelMboxMessageInfo;
 
 struct _CamelMboxSummary {


Index: evolution-data-server.spec
===================================================================
RCS file: /cvs/pkgs/rpms/evolution-data-server/F-13/evolution-data-server.spec,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -p -r1.299 -r1.300
--- evolution-data-server.spec	30 Apr 2010 11:38:12 -0000	1.299
+++ evolution-data-server.spec	10 Jun 2010 07:56:12 -0000	1.300
@@ -25,7 +25,7 @@
 
 Name: evolution-data-server
 Version: 2.30.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group: System Environment/Libraries
 Summary: Backend data server for Evolution
 License: LGPLv2+
@@ -44,6 +44,9 @@ Patch11: evolution-data-server-1.11.5-fi
 #RH bug #587449 / Gnome bug #617263
 Patch12: evolution-data-server-2.30.1-gn617263.patch
 
+#RH bug #602144 / Gnome bug #550414
+Patch13: evolution-data-server-2.30.1-gn550414.patch
+
 ### Build Dependencies ###
 
 BuildRequires: GConf2-devel
@@ -121,6 +124,7 @@ This package contains developer document
 
 %patch11 -p1 -b .fix-64bit-acinclude
 %patch12 -p1 -b .gn617263
+%patch13 -p1 -b .gn550414
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -340,6 +344,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/gtk-doc/html/libedataserverui
 
 %changelog
+* Thu Jun 10 2010 Milan Crha <mcrha at redhat.com> - 2.30.1-3.fc13
+- Add patch for Red Hat bug #602144 (summary and folder mismatch,
+  even after sync)
+
 * Fri Apr 30 2010 Milan Crha <mcrha at redhat.com> - 2.30.1-2.fc13
 - Add patch for Red Hat bug #587449 (use of freed memory)
 



More information about the scm-commits mailing list