184 zfs_putpage() optimization
authorGarrett D'Amore <garrett@nexenta.com>
Mon, 07 Feb 2011 14:16:27 -0800
changeset 13283 4f8f71d21b9f
parent 13282 3f73413df1b2
child 13284 fcadd752253e
184 zfs_putpage() optimization Reviewed by: [email protected] Reviewed by: [email protected] Approved by: [email protected]
usr/src/uts/common/fs/zfs/zfs_vnops.c
--- 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