diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-04-12 17:52:10 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-03 21:54:54 -0700 |
commit | e4b3c0d90c46e6dde97f57fa93ed215b0d34e0c4 (patch) | |
tree | 60b39fe288a35f419ec874931451ecde333a5f0a /libglusterfs/src/iobuf.h | |
parent | d879951ca9e69632517cf13f8f8773c330c14165 (diff) |
iobuf: option to provide larger size of buffers
provide an option to failover to standard allocation if iobuf of
required size doesn't exists. this can be achieved by keeping an
arena dedicated for all the out of boundary allocations.
Change-Id: I41a2bd7d353dc7bcb2e1a6e4b41735afe9865975
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 812784
Reviewed-on: http://review.gluster.com/3136
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/iobuf.h')
-rw-r--r-- | libglusterfs/src/iobuf.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h index 46a54dbfc95..c9792ae8a7c 100644 --- a/libglusterfs/src/iobuf.h +++ b/libglusterfs/src/iobuf.h @@ -40,6 +40,11 @@ #define MAP_ANONYMOUS MAP_ANON #endif +#define GF_ALIGN_BUF(ptr,bound) ((void *)((unsigned long)(ptr + bound - 1) & \ + (unsigned long)(~(bound - 1)))) + +#define GF_IOBUF_ALIGN_SIZE 512 + /* one allocatable unit for the consumers of the IOBUF API */ /* each unit hosts @page_size bytes of memory */ struct iobuf; @@ -71,6 +76,9 @@ struct iobuf { int ref; /* 0 == passive, >0 == active */ void *ptr; /* usable memory region by the consumer */ + + void *free_ptr; /* in case of stdalloc, this is the + one to be freed */ }; |