For logbuffer_take, change order of events so the new logbuffer has...

... a chance to take memory from the old
parent 824b9c95
......@@ -2204,15 +2204,18 @@ logbuffer_init(struct fellow_fd *ffd, struct fellow_logbuffer *lbuf,
static inline void
logbuffer_take(struct fellow_logbuffer *to, struct fellow_logbuffer *from)
{
logbuffer_fini_dskpool_mem(from);
BUDDY_POOL_FINI(from->mempool);
BUDDY_POOL_FINI(from->ffpool);
logbuffer_wait_flush_fini(from);
TAKE(*to, *from);
BUDDY_POOL_INIT(to->mempool, to->membuddy,
*to = *from;
BUDDY_POOL_INIT(to->mempool, from->membuddy,
logbuffer_fill_mempool, to);
BUDDY_POOL_INIT(to->ffpool, to->membuddy,
BUDDY_POOL_INIT(to->ffpool, from->membuddy,
logbuffer_fill_ffpool, to);
logbuffer_fini_dskpool_mem(from);
BUDDY_POOL_FINI(from->mempool);
BUDDY_POOL_FINI(from->ffpool);
memset(from, 0, sizeof *from);
}
static struct fellow_disk_log_block *
......
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