Skip to content

Commit

Permalink
Call dmu_read_uio_dbuf() in zvol_read()
Browse files Browse the repository at this point in the history
The difference between `dmu_read_uio()` and `dmu_read_uio_dbuf()` is
that the former takes a hold while the latter uses an existing hold.
`zfs_read()` in the ZPL will use `dmu_read_uio_dbuf()` while
our analogous `zvol_write()` will use `dmu_write_uio_dbuf()`, but for no
apparent reason, we inherited a `zvol_read()` function from
OpenSolaris that does `dmu_read_uio()`. illumos-gate also still
uses `dmu_read_uio()` to this day. Lets switch to `dmu_read_uio_dbuf()`,
which is more performant.

Signed-off-by: Richard Yao <ryao@gentoo.org>
  • Loading branch information
ryao committed Feb 6, 2016
1 parent ad4a97c commit 6758989
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ zvol_read(struct bio *bio)
if (bytes > volsize - uio.uio_loffset)
bytes = volsize - uio.uio_loffset;

error = dmu_read_uio(zv->zv_objset, ZVOL_OBJ, &uio, bytes);
error = dmu_read_uio_dbuf(zv->zv_dbuf, &uio, bytes);
if (error) {
/* convert checksum errors into IO errors */
if (error == ECKSUM)
Expand Down

0 comments on commit 6758989

Please sign in to comment.