Use BUDDY_POOL_AVAIL_FUNC() for fellow_logblk_new()

parent 1beb0f5d
...@@ -427,6 +427,7 @@ BUDDY_REQS(lbuf_dskpool_mem_s, 1); ...@@ -427,6 +427,7 @@ BUDDY_REQS(lbuf_dskpool_mem_s, 1);
// mem block pool // mem block pool
BUDDY_POOL(lbuf_mempool, 4); // XXX 4 good? BUDDY_POOL(lbuf_mempool, 4); // XXX 4 good?
BUDDY_POOL_GET_FUNC(lbuf_mempool, static) BUDDY_POOL_GET_FUNC(lbuf_mempool, static)
BUDDY_POOL_AVAIL_FUNC(lbuf_mempool, static)
// memory for flush_finish // memory for flush_finish
BUDDY_POOL(lbuf_ffpool, 1); BUDDY_POOL(lbuf_ffpool, 1);
BUDDY_POOL_GET_FUNC(lbuf_ffpool, static) BUDDY_POOL_GET_FUNC(lbuf_ffpool, static)
...@@ -2218,15 +2219,10 @@ fellow_logblk_new( ...@@ -2218,15 +2219,10 @@ fellow_logblk_new(
struct fellow_disk_log_block *logblk; struct fellow_disk_log_block *logblk;
struct buddy_ptr_page e; struct buddy_ptr_page e;
if (wait == 0) { if (wait == 0 && lbuf_mempool_avail(lbuf->mempool) == 0)
// XXX mempool non waiting? return (NULL);
e = buddy_alloc1_ptr_page(lbuf->membuddy, MIN_FELLOW_BITS, 0);
if (e.ptr == NULL) e = buddy_get_next_ptr_page(lbuf_mempool_get(lbuf->mempool, lbuf));
return (NULL);
}
else
e = buddy_get_next_ptr_page(
lbuf_mempool_get(lbuf->mempool, lbuf));
AN(e.ptr); AN(e.ptr);
//lint -e{587} false positive, definitely -- assertion is true //lint -e{587} false positive, definitely -- assertion is true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment