Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2015 08:39:51 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292325 - head/sys/kern
Message-ID:  <201512160839.tBG8dpI1037809@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Dec 16 08:39:51 2015
New Revision: 292325
URL: https://svnweb.freebsd.org/changeset/base/292325

Log:
  Simplify the loop step in the flushbuflist() and make it independed on
  the type stability of the buffers memory.  Instead of memoizing
  pointer to the next buffer and validating it, remember the next
  logical block number in the bo list and re-lookup.
  
  Reviewed by:	markj
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Dec 16 08:25:12 2015	(r292324)
+++ head/sys/kern/vfs_subr.c	Wed Dec 16 08:39:51 2015	(r292325)
@@ -1652,10 +1652,9 @@ flushbuflist(struct bufv *bufv, int flag
 		bp->b_flags &= ~B_ASYNC;
 		brelse(bp);
 		BO_LOCK(bo);
-		if (nbp != NULL &&
-		    (nbp->b_bufobj != bo ||
-		     nbp->b_lblkno != lblkno ||
-		     (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) != xflags))
+		nbp = gbincore(bo, lblkno);
+		if (nbp == NULL || (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN))
+		    != xflags)
 			break;			/* nbp invalid */
 	}
 	return (retval);



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