diff options
Diffstat (limited to 'libglusterfs/src')
| -rw-r--r-- | libglusterfs/src/options.c | 3 | ||||
| -rw-r--r-- | libglusterfs/src/options.h | 3 | ||||
| -rw-r--r-- | libglusterfs/src/xlator.c | 29 | 
3 files changed, 9 insertions, 26 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index 5d436bab38d..842b6413ab4 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -761,7 +761,7 @@ out:  } -static volume_option_t * +volume_option_t *  xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key)  {          volume_option_t         *opt = NULL; @@ -1098,7 +1098,6 @@ pc_or_size (char *in, double *out)          return ret;  } -  DEFINE_INIT_OPT(char *, str, pass);  DEFINE_INIT_OPT(uint64_t, uint64, gf_string2uint64);  DEFINE_INIT_OPT(int64_t, int64, gf_string2int64); diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h index 64c2c64ef59..e2a25baa9e7 100644 --- a/libglusterfs/src/options.h +++ b/libglusterfs/src/options.h @@ -93,6 +93,9 @@ int xlator_options_validate (xlator_t *xl, dict_t *options, char **errstr);  volume_option_t *  xlator_volume_option_get (xlator_t *xl, const char *key); +volume_option_t * +xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key); +  #define DECLARE_INIT_OPT(type_t, type)                                  \  int                                                                     \ diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 348f48c4805..d8997bc7d16 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -119,18 +119,9 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle,          int                     ret = -1;          char                    *name = NULL;          void                    *handle = NULL; -        volume_opt_list_t       *vol_opt = NULL;          GF_VALIDATE_OR_GOTO ("xlator", xlator_type, out); -        GF_ASSERT (dl_handle); - -        if (*dl_handle) -                if (dlclose (*dl_handle)) -                        gf_log ("xlator", GF_LOG_WARNING, "Unable to close " -                                  "previously opened handle( may be stale)." -                                  "Ignoring the invalid handle"); -          ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xlator_type);          if (-1 == ret) {                  gf_log ("xlator", GF_LOG_ERROR, "asprintf failed"); @@ -146,25 +137,15 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle,                  gf_log ("xlator", GF_LOG_WARNING, "%s", dlerror ());                  goto out;          } -        *dl_handle = handle; - -        vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t), -                         gf_common_mt_volume_opt_list_t); - -        if (!vol_opt) { -                goto out; -        } - -        if (!(vol_opt->given_opt = dlsym (handle, "options"))) { +        if (!(opt_list->given_opt = dlsym (handle, "options"))) {                  dlerror (); -                gf_log ("xlator", GF_LOG_DEBUG, -                         "Strict option validation not enforced -- neglecting"); +                gf_log ("xlator", GF_LOG_ERROR, +                        "Failed to load xlator opt table"); +                goto out;          } -        opt_list->given_opt = vol_opt->given_opt; -        INIT_LIST_HEAD (&vol_opt->list); -        list_add_tail (&vol_opt->list, &opt_list->list); +        *dl_handle = handle;          ret = 0;   out:  | 
