diff options
Diffstat (limited to 'glusterfsd/src')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 37 | ||||
| -rw-r--r-- | glusterfsd/src/glusterfsd.h | 1 | 
2 files changed, 37 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index ae74de73f29..9ee88b6d57b 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -203,6 +203,8 @@ static struct argp_option gf_options[] = {       "Instantiate process global timer-wheel"},      {"thin-client", ARGP_THIN_CLIENT_KEY, 0, 0,       "Enables thin mount and connects via gfproxyd daemon"}, +    {"global-threading", ARGP_GLOBAL_THREADING_KEY, "BOOL", OPTION_ARG_OPTIONAL, +     "Use the global thread pool instead of io-threads"},      {0, 0, 0, 0, "Fuse options:"},      {"direct-io-mode", ARGP_DIRECT_IO_MODE_KEY, "BOOL|auto", @@ -697,6 +699,14 @@ set_fuse_mount_options(glusterfs_ctx_t *ctx, dict_t *options)                           cmd_args->fuse_flush_handle_interrupt);              break;      } +    if (cmd_args->global_threading) { +        ret = dict_set_static_ptr(options, "global-threading", "on"); +        if (ret < 0) { +            gf_msg("glusterfsd", GF_LOG_ERROR, 0, glusterfsd_msg_4, +                   "failed to set dict value for key global-threading"); +            goto err; +        } +    }      ret = 0;  err: @@ -1497,6 +1507,7 @@ parse_opts(int key, char *arg, struct argp_state *state)                           "unknown fuse flush handle interrupt setting \"%s\"",                           arg);              break; +          case ARGP_FUSE_AUTO_INVAL_KEY:              if (!arg)                  arg = "yes"; @@ -1507,6 +1518,20 @@ parse_opts(int key, char *arg, struct argp_state *state)              }              break; + +        case ARGP_GLOBAL_THREADING_KEY: +            if (!arg || (*arg == 0)) { +                arg = "yes"; +            } + +            if (gf_string2boolean(arg, &b) == 0) { +                cmd_args->global_threading = b; +                break; +            } + +            argp_failure(state, -1, 0, +                         "Invalid value for global threading \"%s\"", arg); +            break;      }      return 0;  } @@ -2435,6 +2460,10 @@ glusterfs_signals_setup(glusterfs_ctx_t *ctx)      sigaddset(&set, SIGUSR1); /* gf_proc_dump_info */      sigaddset(&set, SIGUSR2); +    /* Signals needed for asynchronous framework. */ +    sigaddset(&set, GF_ASYNC_SIGQUEUE); +    sigaddset(&set, GF_ASYNC_SIGCTRL); +      ret = pthread_sigmask(SIG_BLOCK, &set, NULL);      if (ret) {          gf_msg("glusterfsd", GF_LOG_WARNING, errno, glusterfsd_msg_22, @@ -2845,6 +2874,11 @@ main(int argc, char *argv[])       */      mem_pools_init_late(); +    ret = gf_async_init(ctx); +    if (ret < 0) { +        goto out; +    } +  #ifdef GF_LINUX_HOST_OS      ret = set_oom_score_adj(ctx);      if (ret) @@ -2871,6 +2905,7 @@ main(int argc, char *argv[])      ret = event_dispatch(ctx->event_pool);  out: -    //        glusterfs_ctx_destroy (ctx); +    //    glusterfs_ctx_destroy (ctx); +    gf_async_fini();      return ret;  } diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index 35cf6d88b7a..c91daa0fb54 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -111,6 +111,7 @@ enum argp_option_keys {      ARGP_FUSE_FLUSH_HANDLE_INTERRUPT_KEY = 189,      ARGP_FUSE_LRU_LIMIT_KEY = 190,      ARGP_FUSE_AUTO_INVAL_KEY = 191, +    ARGP_GLOBAL_THREADING_KEY = 192  };  struct _gfd_vol_top_priv {  | 
