dovecot-2.2: lib-fs: Keep track of all fs_iters in fs.

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 15 21:01:54 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/59b920848699
changeset: 17803:59b920848699
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 16 00:01:33 2014 +0300
description:
lib-fs: Keep track of all fs_iters in fs.

diffstat:

 src/lib-fs/fs-api-private.h |  6 +++++-
 src/lib-fs/fs-api.c         |  2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r 784883cc0be6 -r 59b920848699 src/lib-fs/fs-api-private.h
--- a/src/lib-fs/fs-api-private.h	Mon Sep 15 23:57:45 2014 +0300
+++ b/src/lib-fs/fs-api-private.h	Tue Sep 16 00:01:33 2014 +0300
@@ -69,10 +69,11 @@
 
 	unsigned int files_open_count;
 	struct fs_file *files;
+	struct fs_iter *iters;
 };
 
 struct fs_file {
-	/* linked list of all files (mainly for debugging leaks) */
+	/* linked list of all files */
 	struct fs_file *prev, *next;
 
 	struct fs *fs;
@@ -102,6 +103,9 @@
 };
 
 struct fs_iter {
+	/* linked list of all iters */
+	struct fs_iter *prev, *next;
+
 	struct fs *fs;
 	enum fs_iter_flags flags;
 
diff -r 784883cc0be6 -r 59b920848699 src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Mon Sep 15 23:57:45 2014 +0300
+++ b/src/lib-fs/fs-api.c	Tue Sep 16 00:01:33 2014 +0300
@@ -693,6 +693,7 @@
 	T_BEGIN {
 		iter = fs->v.iter_init(fs, path, flags);
 	} T_END;
+	DLLIST_PREPEND(&fs->iters, iter);
 	return iter;
 }
 
@@ -702,6 +703,7 @@
 	int ret;
 
 	*_iter = NULL;
+	DLLIST_REMOVE(&iter->fs->iters, iter);
 	T_BEGIN {
 		ret = iter->fs->v.iter_deinit(iter);
 	} T_END;


More information about the dovecot-cvs mailing list