From 1de29634e5e74610570fe6f378a994bdf65c34cb Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Wed, 2 Oct 2019 08:13:57 +0300 Subject: 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 --- libglusterfs/src/glusterfs/iobuf.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libglusterfs/src/glusterfs') 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]; -- cgit