diff options
author | Richard Yao <[email protected]> | 2016-02-05 23:10:13 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-02-18 10:24:33 -0800 |
commit | 19a47cb1c2be6da9b9d4a395a7afc07da4813a5f (patch) | |
tree | 2d293ad2bf83e67f2a3f981ae1be5fc036c2c1e2 | |
parent | a765a34a3142a1dcedd256e076a54e6ae61953ca (diff) |
Call dmu_read_uio_dbuf() in zvol_read()
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes #4316
-rw-r--r-- | module/zfs/zvol.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 7269cf0c8..52774a82c 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -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) |