changeset 13283:4f8f71d21b9f

184 zfs_putpage() optimization Reviewed by: eric.schrock@delphix.com Reviewed by: george.wilson@delphix.com Approved by: gwr@nexenta.com
author Garrett D'Amore <garrett@nexenta.com>
date Mon, 07 Feb 2011 14:16:27 -0800
parents 3f73413df1b2
children fcadd752253e
files usr/src/uts/common/fs/zfs/zfs_vnops.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/zfs_vnops.c	Sat Feb 05 21:07:28 2011 -0500
+++ b/usr/src/uts/common/fs/zfs/zfs_vnops.c	Mon Feb 07 14:16:27 2011 -0800
@@ -4193,6 +4193,15 @@
 	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