dovecot: Fix to maildirsize reading optimization.

dovecot at dovecot.org dovecot at dovecot.org
Sun Jan 20 13:46:58 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/d719b373a1aa
changeset: 7176:d719b373a1aa
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jan 20 13:46:13 2008 +0200
description:
Fix to maildirsize reading optimization.

diffstat:

1 file changed, 3 insertions(+), 1 deletion(-)
src/plugins/quota/quota-maildir.c |    4 +++-

diffs (28 lines):

diff -r 93fe72ef59f6 -r d719b373a1aa src/plugins/quota/quota-maildir.c
--- a/src/plugins/quota/quota-maildir.c	Sun Jan 20 09:42:01 2008 +0200
+++ b/src/plugins/quota/quota-maildir.c	Sun Jan 20 13:46:13 2008 +0200
@@ -31,6 +31,7 @@ struct maildir_quota_root {
 
 	int fd;
 	time_t recalc_last_stamp;
+	off_t last_size;
 
 	unsigned int limits_initialized:1;
 	unsigned int master_message_limits:1;
@@ -477,7 +478,7 @@ static bool maildirsize_has_changed(stru
 	if (fstat(root->fd, &st2) < 0)
 		return TRUE;
 
-	return st1.st_size != st2.st_size || st1.st_ino != st2.st_ino ||
+	return root->last_size != st2.st_size || st1.st_ino != st2.st_ino ||
 		!CMP_DEV_T(st1.st_dev, st2.st_dev);
 }
 
@@ -513,6 +514,7 @@ static int maildirsize_read(struct maild
 
 	/* file is smaller than 5120 bytes, which means we can use it */
 	root->total_bytes = root->total_count = 0;
+	root->last_size = size;
 
 	/* skip the last line if there's no LF at the end. Remove the last LF
 	   so we don't get one empty line in the strsplit. */


More information about the dovecot-cvs mailing list