The default buffer size when requesting history is 128k. This
is far to large for a kmem_alloc() so instead use the slower
vmem_alloc(). This path has no performance concerns and the
buffer is immediately free'd after its contents are copied to
the user space buffer.
return (ENOTSUP);
}
- hist_buf = kmem_alloc(size, KM_SLEEP);
+ hist_buf = vmem_alloc(size, KM_SLEEP);
if ((error = spa_history_get(spa, &zc->zc_history_offset,
&zc->zc_history_len, hist_buf)) == 0) {
error = ddi_copyout(hist_buf,
}
spa_close(spa, FTAG);
- kmem_free(hist_buf, size);
+ vmem_free(hist_buf, size);
return (error);
}