diff options
| author | Csaba Henk <csaba@gluster.com> | 2010-10-02 07:30:39 +0000 | 
|---|---|---|
| committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-02 06:30:23 -0700 | 
| commit | ef44323b4ba58fa8c1eb89105851983f828dd91b (patch) | |
| tree | dcbfd98a87e1987145ab97366527b4e6e8900902 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
| parent | 067d0e476abe42f1e290039cb903928080e90d8d (diff) | |
volgen: reimplement volgen
Generating a volfile occurs in two steps:
- Build a graph (ie, glusterfs_graph_t instance) by graph manipulation
  primitives
- Write out the graph to a file by the the graph printing API.
Graph builder routines can optionally make use of a "modifier dict",
which can contain overrides wrt. volume options. This can be used
for a "dry-run" graph generation.
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1750 (clean up volgen)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1750
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 16 | 
1 files changed, 5 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 3fa965c8800..8ad9379a73f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -495,8 +495,8 @@ glusterd_volinfo_new (glusterd_volinfo_t **volinfo)          INIT_LIST_HEAD (&new_volinfo->vol_list);          INIT_LIST_HEAD (&new_volinfo->bricks); -        ret = glusterd_default_xlator_options (new_volinfo); -        if (ret) { +        new_volinfo->dict = dict_new (); +        if (!new_volinfo->dict) {                  if (new_volinfo)                          GF_FREE (new_volinfo); @@ -1620,7 +1620,7 @@ glusterd_nfs_server_start ()          glusterd_conf_t         *priv = NULL;          char                    pidfile[PATH_MAX] = {0,};          char                    logfile[PATH_MAX] = {0,}; -        char                    *volfile = NULL; +        char                    volfile[PATH_MAX] = {0,};          char                    path[PATH_MAX] = {0,};          char                    cmd_str[8192] = {0,};          char                    rundir[PATH_MAX] = {0,}; @@ -1641,11 +1641,7 @@ glusterd_nfs_server_start ()          }          GLUSTERD_GET_NFS_PIDFILE(pidfile); -        volfile = glusterd_get_nfs_filepath (); -        if (!volfile) { -                ret = -1; -                goto out; -        } +        glusterd_get_nfs_filepath (volfile);          ret = access (volfile, F_OK);          if (ret) { @@ -1662,8 +1658,6 @@ glusterd_nfs_server_start ()          ret = gf_system (cmd_str);  out: -        if (volfile) -                GF_FREE(volfile);          return ret;  } @@ -1721,7 +1715,7 @@ glusterd_check_generate_start_nfs (glusterd_volinfo_t *volinfo)                  goto out;          } -        ret = volgen_generate_nfs_volfile (volinfo); +        ret = glusterd_create_nfs_volfile ();          if (ret)                  goto out;  | 
