diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-internal.h | 2 | ||||
-rw-r--r-- | api/src/glfs.c | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h index d7d675e81b1..14e94e2116f 100644 --- a/api/src/glfs-internal.h +++ b/api/src/glfs-internal.h @@ -131,6 +131,8 @@ struct glfs_object { #define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) #define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) +#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256 + int glfs_mgmt_init (struct glfs *fs); void glfs_init_done (struct glfs *fs, int ret); int glfs_process_volfp (struct glfs *fs, FILE *fp); diff --git a/api/src/glfs.c b/api/src/glfs.c index 73c46517dad..b69d785a8ab 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -129,6 +129,11 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx) if (!ctx->dict_data_pool) goto err; + ctx->logbuf_pool = mem_pool_new (log_buf_t, + GF_MEMPOOL_COUNT_OF_LRU_BUF_T); + if (!ctx->logbuf_pool) + goto err; + INIT_LIST_HEAD (&pool->all_frames); INIT_LIST_HEAD (&ctx->cmd_args.xlator_options); INIT_LIST_HEAD (&ctx->cmd_args.volfile_servers); @@ -157,6 +162,8 @@ err: mem_pool_destroy (ctx->dict_data_pool); if (ctx->dict_pair_pool) mem_pool_destroy (ctx->dict_pair_pool); + if (ctx->logbuf_pool) + mem_pool_destroy (ctx->logbuf_pool); } return ret; @@ -590,6 +597,10 @@ glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel) if (ret) goto out; + ret = gf_log_inject_timer_event (fs->ctx); + if (ret) + goto out; + out: return ret; } |