changeset 7176:d719b373a1aa HEAD

Fix to maildirsize reading optimization.
author Timo Sirainen <tss@iki.fi>
date Sun, 20 Jan 2008 13:46:13 +0200
parents 93fe72ef59f6
children c1db7b6e5dbc
files src/plugins/quota/quota-maildir.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 
 	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 @@
 	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 @@
 
 	/* 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. */