Skip to content

Commit

Permalink
Use vmem_alloc() for zfs_ioc_pool_get_history()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
behlendorf committed May 6, 2011
1 parent 3613204 commit 34b84cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ zfs_ioc_pool_get_history(zfs_cmd_t *zc)
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,
Expand All @@ -1450,7 +1450,7 @@ zfs_ioc_pool_get_history(zfs_cmd_t *zc)
}

spa_close(spa, FTAG);
kmem_free(hist_buf, size);
vmem_free(hist_buf, size);
return (error);
}

Expand Down

0 comments on commit 34b84cb

Please sign in to comment.