summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/iobuf.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-09-27 18:01:29 +0530
committerAnand Avati <avati@gluster.com>2011-12-07 05:01:52 -0800
commit017344be59fbbd4cf6d29d3f5a6581b468dc29c9 (patch)
tree9caf7fcdb968ad8da5a14f6e0fc9c9a7ddb0d130 /libglusterfs/src/iobuf.h
parent254fbfd92d4088c97ddde79a37b4e08e80c8eff3 (diff)
libglusterfs/iobuf: have fixed number of arenas
* so overall memory usage will be in limit. * the array is hard-coded, need to improve upon this. * need more benchmarking to tune the proper values to the array * fixed the issue of pruning of arenas. Change-Id: I38a8ffab37378c25d78f77a2d412b1b8935c67d3 BUG: 3474 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/543 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'libglusterfs/src/iobuf.h')
-rw-r--r--libglusterfs/src/iobuf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h
index efceb2d05b9..d0f86828615 100644
--- a/libglusterfs/src/iobuf.h
+++ b/libglusterfs/src/iobuf.h
@@ -52,6 +52,10 @@ struct iobuf_arena;
/* expandable and contractable pool of memory, internally broken into arenas */
struct iobuf_pool;
+struct iobuf_init_config {
+ size_t pagesize;
+ int32_t num_pages;
+};
struct iobuf {
union {
@@ -83,6 +87,7 @@ struct iobuf_arena {
size_t arena_size; /* this is equal to
(iobuf_pool->arena_size / page_size)
* page_size */
+ size_t page_count;
struct iobuf_pool *iobuf_pool;
@@ -126,7 +131,7 @@ struct iobuf_pool {
};
-struct iobuf_pool *iobuf_pool_new (size_t arena_size, size_t page_size);
+struct iobuf_pool *iobuf_pool_new (void);
void iobuf_pool_destroy (struct iobuf_pool *iobuf_pool);
struct iobuf *iobuf_get (struct iobuf_pool *iobuf_pool);
void iobuf_unref (struct iobuf *iobuf);