Date: Sat, 1 Jan 2011 17:39:38 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216874 - head/sys/vm Message-ID: <201101011739.p01Hdchb017186@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Sat Jan 1 17:39:38 2011 New Revision: 216874 URL: http://svn.freebsd.org/changeset/base/216874 Log: Make a couple refinements to r216799 and r216810. In particular, revise a comment and move it to its proper place. Reviewed by: kib Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Jan 1 16:59:05 2011 (r216873) +++ head/sys/vm/vm_object.c Sat Jan 1 17:39:38 2011 (r216874) @@ -755,6 +755,12 @@ vm_object_terminate(vm_object_t object) vm_object_destroy(object); } +/* + * Make the page read-only so that we can clear the object flags. However, if + * this is a nosync mmap then the object is likely to stay dirty so do not + * mess with the page and do not clear the object flags. Returns TRUE if the + * page should be flushed, and FALSE otherwise. + */ static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, int *clearobjflags) { @@ -808,15 +814,7 @@ vm_object_page_clean(vm_object_t object, pagerflags |= (flags & OBJPC_INVAL) != 0 ? VM_PAGER_PUT_INVAL : 0; tend = (end == 0) ? object->size : end; - - /* - * Make the page read-only so we can then clear the object flags. - * - * However, if this is a nosync mmap then the object is likely to - * stay dirty so do not mess with the page and do not clear the - * object flags. - */ - clearobjflags = 1; + clearobjflags = start == 0 && tend == object->size; rescan: curgeneration = object->generation; @@ -847,7 +845,7 @@ rescan: VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif - if (clearobjflags && start == 0 && tend == object->size) + if (clearobjflags) vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101011739.p01Hdchb017186>