]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Call dmu_read_uio_dbuf() in zvol_read()
authorRichard Yao <ryao@gentoo.org>
Sat, 6 Feb 2016 04:10:13 +0000 (23:10 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 18 Feb 2016 18:24:33 +0000 (10:24 -0800)
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>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes #4316

module/zfs/zvol.c

index 7269cf0c827763848f03b9f6e6f820245e756a54..52774a82ce6e70fff5d8ac064b671162a4b37636 100644 (file)
@@ -731,7 +731,7 @@ zvol_read(zvol_state_t *zv, uio_t *uio)
                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)