]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: fs_class_register() can now be called externally.
authorTimo Sirainen <tss@iki.fi>
Thu, 16 Apr 2015 15:20:15 +0000 (18:20 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 16 Apr 2015 15:20:15 +0000 (18:20 +0300)
src/lib-fs/fs-api-private.h
src/lib-fs/fs-api.c

index 5e5bc2893d436553db3693ecb02ef8c569cbf60c..5c67a7f34426750179abbb86e38da212897143ee 100644 (file)
@@ -138,6 +138,8 @@ extern const struct fs fs_class_metawrap;
 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);
 
index b6469b1b2e785213e0ac31523c8bb20839d09942..8609adc6d0ac60633b4bb0c55988f3b7412fb295 100644 (file)
@@ -16,6 +16,8 @@ struct fs_api_module_register fs_api_module_register = { 0 };
 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 @@ fs_alloc(const struct fs *fs_class, const char *args,
        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);
 }