1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Allow pool_begin_object in empty pool.

This commit is contained in:
Alasdair Kergon 2002-01-09 13:06:02 +00:00
parent 83912faa1d
commit 67fb2a39a7

View File

@ -138,8 +138,10 @@ int pool_begin_object(struct pool *p, size_t hint)
p->object_len = 0; p->object_len = 0;
p->object_alignment = align; p->object_alignment = align;
_align_chunk(c, align); if (c)
if (c->end - c->begin < hint) { _align_chunk(c, align);
if (!c || (c->begin > c->end) || (c->end - c->begin < hint)) {
/* allocate a new chunk */ /* allocate a new chunk */
c = _new_chunk(p, c = _new_chunk(p,
hint > (p->chunk_size - sizeof(struct chunk)) ? hint > (p->chunk_size - sizeof(struct chunk)) ?