dovecot-1.1: maildir copy: Try to use hard linking also between ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 2 19:18:58 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/76bc7f7e1d60
changeset: 7590:76bc7f7e1d60
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 02 19:17:31 2008 +0300
description:
maildir copy: Try to use hard linking also between different namespaces.

diffstat:

1 file changed, 7 insertions(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-copy.c |    8 +++++++-

diffs (25 lines):

diff -r f681e55f5c60 -r 76bc7f7e1d60 src/lib-storage/index/maildir/maildir-copy.c
--- a/src/lib-storage/index/maildir/maildir-copy.c	Mon Jun 02 18:57:13 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-copy.c	Mon Jun 02 19:17:31 2008 +0300
@@ -114,6 +114,13 @@ maildir_copy_hardlink(struct maildir_tra
 	uint32_t seq;
 
 	i_assert((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
+
+	if (strcmp(mail->box->storage->name, MAILDIR_STORAGE_NAME) == 0)
+		src_mbox = (struct maildir_mailbox *)mail->box;
+	else {
+		/* Can't hard link files from the source storage */
+		return 0;
+	}
 
 	if (t->save_ctx == NULL)
 		t->save_ctx = maildir_save_transaction_init(t);
@@ -223,7 +230,6 @@ int maildir_copy(struct mailbox_transact
 	int ret;
 
 	if (mbox->storage->copy_with_hardlinks &&
-	    mail->box->storage == mbox->ibox.box.storage &&
 	    maildir_compatible_file_modes(&mbox->ibox.box, mail->box)) {
 		T_BEGIN {
 			ret = maildir_copy_hardlink(t, mail, flags,


More information about the dovecot-cvs mailing list