From c4fc6b2110a79240282dafa6c538f2b42a6b8e2a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 7 Feb 2011 14:16:27 -0800 Subject: [PATCH] 184 zfs_putpage() optimization Reviewed by: eric.schrock@delphix.com Reviewed by: george.wilson@delphix.com Approved by: gwr@nexenta.com --- usr/src/uts/common/fs/zfs/zfs_vnops.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usr/src/uts/common/fs/zfs/zfs_vnops.c b/usr/src/uts/common/fs/zfs/zfs_vnops.c index a0720079cf..6081470b0b 100644 --- a/usr/src/uts/common/fs/zfs/zfs_vnops.c +++ b/usr/src/uts/common/fs/zfs/zfs_vnops.c @@ -4193,6 +4193,15 @@ zfs_putpage(vnode_t *vp, offset_t off, size_t len, int flags, cred_t *cr, ZFS_VERIFY_ZP(zp); /* + * There's nothing to do if no data is cached. + */ + if (!vn_has_cached_data(vp)) { + ASSERT(len == 0); + ZFS_EXIT(zfsvfs); + return (0); + } + + /* * Align this request to the file block size in case we kluster. * XXX - this can result in pretty aggresive locking, which can * impact simultanious read/write access. One option might be -- 2.11.4.GIT