dovecot-2.2: lib-fs: Added fs_get_parent() and fs_get_driver()

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 5 21:05:29 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/422b5a01d18e
changeset: 18289:422b5a01d18e
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 05 22:17:09 2015 +0200
description:
lib-fs: Added fs_get_parent() and fs_get_driver()
These can be used to iterate through fs wrappers and see what they are.

diffstat:

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

diffs (35 lines):

diff -r fdc7a0a2b18d -r 422b5a01d18e src/lib-fs/fs-api.c
--- a/src/lib-fs/fs-api.c	Tue Mar 03 19:48:23 2015 +0200
+++ b/src/lib-fs/fs-api.c	Thu Mar 05 22:17:09 2015 +0200
@@ -155,6 +155,16 @@
 	str_free(&last_error);
 }
 
+struct fs *fs_get_parent(struct fs *fs)
+{
+	return fs->parent;
+}
+
+const char *fs_get_driver(struct fs *fs)
+{
+	return fs->name;
+}
+
 const char *fs_get_root_driver(struct fs *fs)
 {
 	while (fs->parent != NULL)
diff -r fdc7a0a2b18d -r 422b5a01d18e src/lib-fs/fs-api.h
--- a/src/lib-fs/fs-api.h	Tue Mar 03 19:48:23 2015 +0200
+++ b/src/lib-fs/fs-api.h	Thu Mar 05 22:17:09 2015 +0200
@@ -135,6 +135,11 @@
 	    struct fs **fs_r, const char **error_r);
 void fs_deinit(struct fs **fs);
 
+/* Returns the parent filesystem (if this is a wrapper fs) or NULL if
+   there's no parent. */
+struct fs *fs_get_parent(struct fs *fs);
+/* Returns the filesystem's driver name. */
+const char *fs_get_driver(struct fs *fs);
 /* Returns the root fs's driver name (bypassing all wrapper fses) */
 const char *fs_get_root_driver(struct fs *fs);
 


More information about the dovecot-cvs mailing list