Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 2010 10:31:27 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212650 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs
Message-ID:  <201009151031.o8FAVRGa030118@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Sep 15 10:31:27 2010
New Revision: 212650
URL: http://svn.freebsd.org/changeset/base/212650

Log:
  tmpfs, zfs + sendfile: mark page bits as valid after populating it with data
  
  Otherwise, adding insult to injury, in addition to double-caching of data
  we would always copy the data into a vnode's vm object page from backend.
  This is specific to sendfile case only (VOP_READ with UIO_NOCOPY).
  
  PR:		kern/141305
  Reported by:	Wiktor Niesiobedzki <bsd@vink.pl>
  Reviewed by:	alc
  Tested by:	tools/regression/sockets/sendfile
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Sep 15 10:18:18 2010	(r212649)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Sep 15 10:31:27 2010	(r212650)
@@ -498,6 +498,8 @@ again:
 				sched_unpin();
 			}
 			VM_OBJECT_LOCK(obj);
+			if (error == 0)
+				vm_page_set_valid(m, off, bytes);
 			vm_page_wakeup(m);
 			if (error == 0)
 				uio->uio_resid -= bytes;

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Sep 15 10:18:18 2010	(r212649)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c	Wed Sep 15 10:31:27 2010	(r212650)
@@ -562,6 +562,8 @@ lookupvpg:
 		sf_buf_free(sf);
 		sched_unpin();
 		VM_OBJECT_LOCK(vobj);
+		if (error == 0)
+			vm_page_set_valid(m, offset, tlen);
 		vm_page_wakeup(m);
 		VM_OBJECT_UNLOCK(vobj);
 		return	(error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009151031.o8FAVRGa030118>