Register correct handlers in nvlist_alloc()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 18 Jun 2013 17:15:33 +0000 (10:15 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 20 Jun 2013 16:58:15 +0000 (09:58 -0700)
The non-blocking allocation handlers in nvlist_alloc() would be
mistakenly assigned if any flags other than KM_SLEEP were passed.
This meant that nvlists allocated with KM_PUSHPUSH or other KM_*
debug flags were effectively always using atomic allocations.

While these failures were unlikely it could lead to assertions
because KM_PUSHPAGE allocations in particular are guaranteed to
succeed or block.  They must never fail.

Since the existing API does not allow us to pass allocation
flags to the private allocators the cleanest thing to do is to
add a KM_PUSHPAGE allocator.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/spl#249


No differences found