diff options
author | Max Grossman <max.grossman@delphix.com> | 2013-12-09 10:37:51 -0800 |
---|---|---|
committer | Christopher Siden <chris.siden@delphix.com> | 2013-12-09 10:37:51 -0800 |
commit | 43466aae47bfcd2ad9bf501faec8e75c08095e4f (patch) | |
tree | aa3cae025bffb4c9bf3e81cc7a2c5a8868ce8577 /usr/src/uts/common/fs/zfs/vdev_cache.c | |
parent | 065c692a88e4dcdd0c6eadc2476c046d6ee9dd1c (diff) | |
download | illumos-gate-43466aae47bfcd2ad9bf501faec8e75c08095e4f.tar.gz |
4370 avoid transmitting holes during zfs send
4371 DMU code clean up
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/fs/zfs/vdev_cache.c')
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev_cache.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev_cache.c b/usr/src/uts/common/fs/zfs/vdev_cache.c index 800641e61f..678c4e40ea 100644 --- a/usr/src/uts/common/fs/zfs/vdev_cache.c +++ b/usr/src/uts/common/fs/zfs/vdev_cache.c @@ -248,9 +248,9 @@ vdev_cache_fill(zio_t *fio) } /* - * Read data from the cache. Returns 0 on cache hit, errno on a miss. + * Read data from the cache. Returns B_TRUE cache hit, B_FALSE on miss. */ -int +boolean_t vdev_cache_read(zio_t *zio) { vdev_cache_t *vc = &zio->io_vd->vdev_cache; @@ -262,16 +262,16 @@ vdev_cache_read(zio_t *zio) ASSERT(zio->io_type == ZIO_TYPE_READ); if (zio->io_flags & ZIO_FLAG_DONT_CACHE) - return (SET_ERROR(EINVAL)); + return (B_FALSE); if (zio->io_size > zfs_vdev_cache_max) - return (SET_ERROR(EOVERFLOW)); + return (B_FALSE); /* * If the I/O straddles two or more cache blocks, don't cache it. */ if (P2BOUNDARY(zio->io_offset, zio->io_size, VCBS)) - return (SET_ERROR(EXDEV)); + return (B_FALSE); ASSERT(cache_phase + zio->io_size <= VCBS); @@ -283,7 +283,7 @@ vdev_cache_read(zio_t *zio) if (ve != NULL) { if (ve->ve_missed_update) { mutex_exit(&vc->vc_lock); - return (SET_ERROR(ESTALE)); + return (B_FALSE); } if ((fio = ve->ve_fill_io) != NULL) { @@ -291,7 +291,7 @@ vdev_cache_read(zio_t *zio) zio_add_child(zio, fio); mutex_exit(&vc->vc_lock); VDCSTAT_BUMP(vdc_stat_delegations); - return (0); + return (B_TRUE); } vdev_cache_hit(vc, ve, zio); @@ -299,14 +299,14 @@ vdev_cache_read(zio_t *zio) mutex_exit(&vc->vc_lock); VDCSTAT_BUMP(vdc_stat_hits); - return (0); + return (B_TRUE); } ve = vdev_cache_allocate(zio); if (ve == NULL) { mutex_exit(&vc->vc_lock); - return (SET_ERROR(ENOMEM)); + return (B_FALSE); } fio = zio_vdev_delegated_io(zio->io_vd, cache_offset, @@ -321,7 +321,7 @@ vdev_cache_read(zio_t *zio) zio_nowait(fio); VDCSTAT_BUMP(vdc_stat_misses); - return (0); + return (B_TRUE); } /* |