diff options
| author | Amar Tumballi <amarts@redhat.com> | 2012-09-06 00:13:04 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2012-09-06 00:34:15 -0700 | 
| commit | d6c99b6134f1eb90b3a8020c3538101df266e9b5 (patch) | |
| tree | a5ec27bcf3136ddfda5ce5f21917bea50ad3be58 /libglusterfs/src/graph-print.c | |
| parent | 54b71368ef290bc579f113e683a82b09893fb50a (diff) | |
libglusterfs/dict: make 'dict_t' a opaque object
* ie, don't dereference dict_t pointer, instead use APIs everywhere
* other than dict_t only 'data_t' should be the valid export from dict.h
* added 'dict_foreach_fnmatch()' API
* changed dict_lookup() to use data_t, instead of data_pair_t
Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 850917
Reviewed-on: http://review.gluster.org/3829
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/graph-print.c')
| -rw-r--r-- | libglusterfs/src/graph-print.c | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/libglusterfs/src/graph-print.c b/libglusterfs/src/graph-print.c index 66712986496..862a93000e5 100644 --- a/libglusterfs/src/graph-print.c +++ b/libglusterfs/src/graph-print.c @@ -92,7 +92,6 @@ glusterfs_graph_print (struct gf_printer *gp, glusterfs_graph_t *graph)          } while (0)          xlator_t      *trav = NULL; -        data_pair_t   *pair = NULL;          xlator_list_t *xch = NULL;          int            ret = 0;          ssize_t        len = 0; @@ -105,11 +104,18 @@ glusterfs_graph_print (struct gf_printer *gp, glusterfs_graph_t *graph)                  GPPRINTF (gp, "volume %s\n    type %s\n", trav->name,                            trav->type); -                for (pair =  trav->options->members_list; pair && pair->next; -                     pair = pair->next); -                for (; pair; pair = pair->prev) -                        GPPRINTF (gp, "    option %s %s\n", pair->key, -                                  pair->value->data); +                int _print_volume_options (dict_t *d, char *k, data_t *v, +                                           void *tmp) +                { +                        GPPRINTF (gp, "    option %s %s\n", k, v->data); +                        return 0; +                out: +                        /* means, it is a failure */ +                        return -1; +                } +                ret = dict_foreach (trav->options, _print_volume_options, NULL); +                if (ret) +                        goto out;                  if (trav->children) {                          GPPRINTF (gp, "    subvolumes");  | 
