dovecot-2.2: lib-fs: Added fs_get_root_driver()

dovecot at dovecot.org dovecot at dovecot.org
Tue May 28 01:04:07 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/16183ae98947
changeset: 16404:16183ae98947
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 28 01:03:58 2013 +0300
description:
lib-fs: Added fs_get_root_driver()

diffstat:

 src/lib-fs/fs-api.c |  7 +++++++
 src/lib-fs/fs-api.h |  3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 967ef2a7fa6f -r 16183ae98947 src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Mon May 27 21:03:14 2013 +0300
+++ b/src/lib-fs/fs-api.c	Tue May 28 01:03:58 2013 +0300
@@ -140,6 +140,13 @@
 	str_free(&last_error);
 }
 
+const char *fs_get_root_driver(struct fs *fs)
+{
+	while (fs->parent != NULL)
+		fs = fs->parent;
+	return fs->name;
+}
+
 struct fs_file *fs_file_init(struct fs *fs, const char *path, int mode_flags)
 {
 	struct fs_file *file;
diff -r 967ef2a7fa6f -r 16183ae98947 src/lib-fs/fs-api.h
--- a/src/lib-fs/fs-api.h	Mon May 27 21:03:14 2013 +0300
+++ b/src/lib-fs/fs-api.h	Tue May 28 01:03:58 2013 +0300
@@ -92,6 +92,9 @@
 	    struct fs **fs_r, const char **error_r);
 void fs_deinit(struct fs **fs);
 
+/* Returns the root fs's driver name (bypassing all wrapper fses) */
+const char *fs_get_root_driver(struct fs *fs);
+
 struct fs_file *fs_file_init(struct fs *fs, const char *path, int mode_flags);
 void fs_file_deinit(struct fs_file **file);
 


More information about the dovecot-cvs mailing list