dovecot-2.2: lib-fs: fs_class_register() can now be called exter...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 16 15:21:42 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/4ced4305d960
changeset: 18408:4ced4305d960
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 16 18:20:15 2015 +0300
description:
lib-fs: fs_class_register() can now be called externally.

diffstat:

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

diffs (36 lines):

diff -r 0f4b010b78b6 -r 4ced4305d960 src/lib-fs/fs-api-private.h
--- a/src/lib-fs/fs-api-private.h	Thu Apr 16 14:19:51 2015 +0300
+++ b/src/lib-fs/fs-api-private.h	Thu Apr 16 18:20:15 2015 +0300
@@ -138,6 +138,8 @@
 extern const struct fs fs_class_sis;
 extern const struct fs fs_class_sis_queue;
 
+void fs_class_register(const struct fs *fs_class);
+
 void fs_set_error(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
 void fs_set_critical(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
 
diff -r 0f4b010b78b6 -r 4ced4305d960 src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Thu Apr 16 14:19:51 2015 +0300
+++ b/src/lib-fs/fs-api.c	Thu Apr 16 18:20:15 2015 +0300
@@ -16,6 +16,8 @@
 static struct module *fs_modules = NULL;
 static ARRAY(const struct fs *) fs_classes;
 
+static void fs_classes_init(void);
+
 static int
 fs_alloc(const struct fs *fs_class, const char *args,
 	 const struct fs_settings *set, struct fs **fs_r, const char **error_r)
@@ -45,8 +47,10 @@
 	return 0;
 }
 
-static void fs_class_register(const struct fs *fs_class)
+void fs_class_register(const struct fs *fs_class)
 {
+	if (!array_is_created(&fs_classes))
+		fs_classes_init();
 	array_append(&fs_classes, &fs_class, 1);
 }
 


More information about the dovecot-cvs mailing list