diff options
author | Matthew Ahrens <[email protected]> | 2015-06-16 23:06:27 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-06-29 14:33:23 -0700 |
commit | 804e050457f1755cc37f39ef1f88786ba7e688d5 (patch) | |
tree | 0aa31c5df69c9c04d30ee9098280e7506f116271 /module/zfs/zfs_vnops.c | |
parent | d6c9ff0a6be1e4b87f71a641a8973070ec46d01b (diff) |
Illumos 5175 - implement dmu_read_uio_dbuf() to improve cached read performance
5175 implement dmu_read_uio_dbuf() to improve cached read performance
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Alex Reece <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
References:
https://www.illumos.org/issues/5175
https://github.com/illumos/illumos-gate/commit/f8554bb
Porting notes:
This patch doesn't include the changes for the COMSTAR (Common
Multiprotocol SCSI Target) - since it's not available for ZoL.
http://thegreyblog.blogspot.co.at/2010/02/setting-up-solaris-comstar-and.html
Ported by: kernelOfTruth <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3392
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r-- | module/zfs/zfs_vnops.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 19a4132e4..7780fe902 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -376,7 +376,6 @@ mappedread(struct inode *ip, int nbytes, uio_t *uio) struct address_space *mp = ip->i_mapping; struct page *pp; znode_t *zp = ITOZ(ip); - objset_t *os = ITOZSB(ip)->z_os; int64_t start, off; uint64_t bytes; int len = nbytes; @@ -403,7 +402,8 @@ mappedread(struct inode *ip, int nbytes, uio_t *uio) unlock_page(pp); page_cache_release(pp); } else { - error = dmu_read_uio(os, zp->z_id, uio, bytes); + error = dmu_read_uio_dbuf(sa_get_db(zp->z_sa_hdl), + uio, bytes); } len -= bytes; @@ -440,7 +440,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) { znode_t *zp = ITOZ(ip); zfs_sb_t *zsb = ITOZSB(ip); - objset_t *os; ssize_t n, nbytes; int error = 0; rl_t *rl; @@ -450,7 +449,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) ZFS_ENTER(zsb); ZFS_VERIFY_ZP(zp); - os = zsb->z_os; if (zp->z_pflags & ZFS_AV_QUARANTINED) { ZFS_EXIT(zsb); @@ -531,10 +529,12 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) nbytes = MIN(n, zfs_read_chunk_size - P2PHASE(uio->uio_loffset, zfs_read_chunk_size)); - if (zp->z_is_mapped && !(ioflag & O_DIRECT)) + if (zp->z_is_mapped && !(ioflag & O_DIRECT)) { error = mappedread(ip, nbytes, uio); - else - error = dmu_read_uio(os, zp->z_id, uio, nbytes); + } else { + error = dmu_read_uio_dbuf(sa_get_db(zp->z_sa_hdl), + uio, nbytes); + } if (error) { /* convert checksum errors into IO errors */ |