diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-10-02 08:13:57 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-11-07 08:30:24 +0000 |
commit | 1de29634e5e74610570fe6f378a994bdf65c34cb (patch) | |
tree | 19c25b8702bd73ddf55374277542de11a659d49f /libglusterfs/src/glusterfs | |
parent | 6b05f29808b187ce720c26e226be673b917ae668 (diff) |
iobuf.c, h: minor fixes
- Align structures
- gf_iobuf_get_pagesize() will now also return the index, reducing the need
for an additional very similar call.
- Removal of an inefficient loop I've inadvertently added previously.
It was harmless, but just inefficient.
- New pool initialization does not need to be done under lock - no
one can touch that pool yet, so no need to protect it.
Change-Id: I61c50f2f14fa79edc131e515e9615a9928ee2dca
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs')
-rw-r--r-- | libglusterfs/src/glusterfs/iobuf.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libglusterfs/src/glusterfs/iobuf.h b/libglusterfs/src/glusterfs/iobuf.h index 792d4fe1529..4bd443efd5e 100644 --- a/libglusterfs/src/glusterfs/iobuf.h +++ b/libglusterfs/src/glusterfs/iobuf.h @@ -95,14 +95,14 @@ struct iobuf_arena { void *mem_base; struct iobuf *iobufs; /* allocated iobufs list */ - int active_cnt; - struct iobuf active; /* head node iobuf - (unused by itself) */ - int passive_cnt; + struct iobuf active; /* head node iobuf + (unused by itself) */ struct iobuf passive; /* head node iobuf (unused by itself) */ uint64_t alloc_cnt; /* total allocs in this pool */ - int max_active; /* max active buffers at a given time */ + int active_cnt; + int passive_cnt; + int max_active; /* max active buffers at a given time */ }; struct iobuf_pool { @@ -111,7 +111,6 @@ struct iobuf_pool { arena */ size_t default_page_size; /* default size of iobuf */ - int arena_cnt; struct list_head all_arenas; struct list_head arenas[GF_VARIABLE_IOBUF_COUNT]; /* array of arenas. Each element of the array is a list of arenas @@ -125,6 +124,7 @@ struct iobuf_pool { uint64_t request_misses; /* mostly the requests for higher value of iobufs */ + int arena_cnt; int rdma_device_count; struct list_head *mr_list[GF_RDMA_DEVICE_COUNT]; void *device[GF_RDMA_DEVICE_COUNT]; |