svn commit: r248245 - user/attilio/vmobj-readlock/sys/kern

Attilio Rao attilio at FreeBSD.org
Wed Mar 13 15:20:19 UTC 2013


Author: attilio
Date: Wed Mar 13 15:20:18 2013
New Revision: 248245
URL: http://svnweb.freebsd.org/changeset/base/248245

Log:
  Revert read locking in brelse().
  For the time being vm_page_set_invalid() requires write locking on obj.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/attilio/vmobj-readlock/sys/kern/vfs_bio.c

Modified: user/attilio/vmobj-readlock/sys/kern/vfs_bio.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/kern/vfs_bio.c	Wed Mar 13 15:09:00 2013	(r248244)
+++ user/attilio/vmobj-readlock/sys/kern/vfs_bio.c	Wed Mar 13 15:20:18 2013	(r248245)
@@ -1389,7 +1389,7 @@ brelse(struct buf *bp)
 		 */
 		resid = bp->b_bufsize;
 		foff = bp->b_offset;
-		VM_OBJECT_RLOCK(obj);
+		VM_OBJECT_WLOCK(obj);
 		for (i = 0; i < bp->b_npages; i++) {
 			int had_bogus = 0;
 
@@ -1437,7 +1437,7 @@ brelse(struct buf *bp)
 			resid -= PAGE_SIZE - (foff & PAGE_MASK);
 			foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK;
 		}
-		VM_OBJECT_RUNLOCK(obj);
+		VM_OBJECT_WUNLOCK(obj);
 		if (bp->b_flags & (B_INVAL | B_RELBUF))
 			vfs_vmio_release(bp);
 


More information about the svn-src-user mailing list