[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-save.c, 1.70.2.6, 1.70.2.7 maildir-uidlist.c, 1.51.2.6, 1.51.2.7

tss at dovecot.org tss at dovecot.org
Sat Mar 10 22:58:47 EET 2007


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

Modified Files:
      Tag: branch_1_0
	maildir-save.c maildir-uidlist.c 
Log Message:
Added fsync_disable setting.



Index: maildir-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.70.2.6
retrieving revision 1.70.2.7
diff -u -d -r1.70.2.6 -r1.70.2.7
--- maildir-save.c	22 Feb 2007 14:08:42 -0000	1.70.2.6
+++ maildir-save.c	10 Mar 2007 20:58:44 -0000	1.70.2.7
@@ -366,12 +366,12 @@
 	output_errno = ctx->output->stream_errno;
 	o_stream_destroy(&ctx->output);
 
-	/* 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(STORAGE(ctx->mbox->storage),
-					  "fsync(%s) failed: %m", path);
-		ctx->failed = TRUE;
+	if (!ctx->mbox->ibox.fsync_disable) {
+		if (fsync(ctx->fd) < 0) {
+			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(STORAGE(ctx->mbox->storage),

Index: maildir-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-uidlist.c,v
retrieving revision 1.51.2.6
retrieving revision 1.51.2.7
diff -u -d -r1.51.2.6 -r1.51.2.7
--- maildir-uidlist.c	22 Feb 2007 12:50:09 -0000	1.51.2.6
+++ maildir-uidlist.c	10 Mar 2007 20:58:44 -0000	1.51.2.7
@@ -618,10 +618,12 @@
 		return -1;
 	}
 
-	if (fsync(uidlist->lock_fd) < 0) {
-		mail_storage_set_critical(storage,
-			"fsync(%s) failed: %m", temp_path);
-		return -1;
+	if (!uidlist->mbox->ibox.fsync_disable) {
+		if (fsync(uidlist->lock_fd) < 0) {
+			mail_storage_set_critical(storage,
+				"fsync(%s) failed: %m", temp_path);
+			return -1;
+		}
 	}
 
 	return 0;



More information about the dovecot-cvs mailing list