From e701fb2713510f80a8a45c932637bcb52b5a103e Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 21 Mar 2013 15:09:01 -0700 Subject: glusterfsd: dump the in-memory graph rather than volfile Currently we have been printing in the logfile, the volfile verbatim as received from the server. However we perform pre-processing on the graph we receive from the server, like adding ACL translator, applying --xlator-option cli params, etc. So print the serialized in-memory graph as the "volfile" in the log. This can be very handy to double check if certain --xlator-option param actually got applied or not, and in general is showing a "truer" representation of the real graph actually used. Change-Id: I0221dc56e21111b48a1ee3e5fe17a5ef820dc0c6 BUG: 924504 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/4708 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/xlator.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libglusterfs/src/xlator.c') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 3fb6eeebb..9bde4fa8f 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -322,6 +322,24 @@ out: } +void +xlator_foreach_depth_first (xlator_t *this, + void (*fn)(xlator_t *each, void *data), + void *data) +{ + xlator_list_t *subv = NULL; + + subv = this->children; + + while (subv) { + xlator_foreach_depth_first (subv->xlator, fn, data); + subv = subv->next; + } + + fn (this, data); +} + + xlator_t * xlator_search_by_name (xlator_t *any, const char *name) { -- cgit