diff options
Diffstat (limited to 'xlators/protocol/server/src/server.c')
| -rw-r--r-- | xlators/protocol/server/src/server.c | 34 | 
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index a8597ca194a..73a453c744e 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -738,6 +738,17 @@ reconfigure (xlator_t *this, dict_t *options)                  goto out;          } +        GF_OPTION_RECONF ("manage-gids", conf->server_manage_gids, options, +                          bool, out); + +        GF_OPTION_RECONF ("gid-timeout", conf->gid_cache_timeout, options, +                          int32, out); +        if (gid_cache_reconf (&conf->gid_cache, conf->gid_cache_timeout) < 0) { +                gf_log(this->name, GF_LOG_ERROR, "Failed to reconfigure group " +                        "cache."); +                goto out; +        } +          rpc_conf = conf->rpc;          if (!rpc_conf) {                  gf_log (this->name, GF_LOG_ERROR, "No rpc_conf !!!!"); @@ -865,6 +876,19 @@ init (xlator_t *this)                  goto out;          } +        ret = dict_get_str_boolean (this->options, "manage-gids", _gf_false); +        if (ret == -1) +                conf->server_manage_gids = _gf_false; +        else +                conf->server_manage_gids = ret; + +        GF_OPTION_INIT("gid-timeout", conf->gid_cache_timeout, int32, out); +        if (gid_cache_init (&conf->gid_cache, conf->gid_cache_timeout) < 0) { +                gf_log(this->name, GF_LOG_ERROR, "Failed to initialize " +                        "group cache."); +                goto out; +        } +          /* RPC related */          conf->rpc = rpcsvc_init (this, this->ctx, this->options, 0);          if (conf->rpc == NULL) { @@ -1112,6 +1136,16 @@ struct volume_options options[] = {                           "overrides the auth.allow option. By default, all"                           " connections are allowed."          }, +        { .key   = {"manage-gids"}, +          .type  = GF_OPTION_TYPE_BOOL, +          .default_value = "off", +          .description = "Resolve groups on the server-side." +        }, +        { .key = {"gid-timeout"}, +          .type = GF_OPTION_TYPE_INT, +          .default_value = "2", +          .description = "Timeout in seconds for the cached groups to expire." +        },          { .key   = {NULL} },  };  | 
