--- releng_7_ref/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c 2009-05-20 16:39:36.677203795 -0700 +++ releng_7_2_fcs/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c 2009-08-17 14:50:55.332013723 -0700 @@ -305,7 +305,9 @@ * modified in a number of different ways. */ - rw_enter(&zf->zf_rwlock, RW_READER); + if (rw_tryenter(&zf->zf_rwlock, RW_READER) == 0) + return (1); + top: for (zs = list_head(&zf->zf_stream); zs; @@ -339,8 +341,10 @@ reset = !prefetched && zs->zst_len > 1; - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if (zh->zst_offset != zs->zst_offset + zs->zst_len) { mutex_exit(&zs->zst_lock); goto top; @@ -364,8 +368,10 @@ reset = !prefetched && zs->zst_len > 1; - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if (zh->zst_offset != zs->zst_offset - zh->zst_len) { mutex_exit(&zs->zst_lock); goto top; @@ -392,8 +398,10 @@ zs->zst_len) && (zs->zst_len != zs->zst_stride)) { /* strided forward access */ - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if ((zh->zst_offset - zs->zst_offset - zs->zst_stride >= zs->zst_len) || (zs->zst_len == zs->zst_stride)) { mutex_exit(&zs->zst_lock); @@ -409,8 +417,10 @@ zs->zst_len) && (zs->zst_len != zs->zst_stride)) { /* strided reverse access */ - mutex_enter(&zs->zst_lock); - + if (mutex_tryenter(&zs->zst_lock) == 0) { + rc = 1; + goto out; + } if ((zh->zst_offset - zs->zst_offset + zs->zst_stride >= zs->zst_len) || (zs->zst_len == zs->zst_stride)) { mutex_exit(&zs->zst_lock);